Coder Social home page Coder Social logo

mqshimmering's Introduction

MQShimmering

仿Facebook shimmering效果, 支持角度倾斜, 颜色渐变, 图片

与Facebook不同点在于,FBShimmering是在label上加mask,不能灵活的设置label字体颜色,而MQShimmering是用label作为mask添加到view上, 可以独立设置label字体颜色和倾斜角度,并且可以使用图片作为遮罩.

let shimmeringView = MQShimmeringView(frame: CGRect(x: 100, y: 150, width: 200, height: 50))
shimmeringView.shimmeringColorArray = [UIColor.white.withAlphaComponent(0.1),
				       UIColor.white.withAlphaComponent(1), 
 				       UIColor.white.withAlphaComponent(0.1)]
shimmeringView.shimmeringTextColor = UIColor.blue
shimmeringView.shimmeringRotationAngle = 20.0
shimmeringView.shimmeringLength = 200
shimmeringView.isShimmering = true
view.addSubview(shimmeringView)

let contentLabel = UILabel(frame: shimmeringView.bounds)
contentLabel.font = UIFont.systemFont(ofSize: 30)
contentLabel.text = "hello world"
shimmeringView.setContentView(contentLabel)

mqshimmering's People

Contributors

mq3616 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.