iOS 7.1 Slide To Unlock Text Animation

前端 未结 8 1851
傲寒
傲寒 2021-02-05 11:56

I\'m not sure if this has been asked before, but I\'m having a hard time finding it. Perhaps I\'m not using the right search terms, so if an answer already exists, if someone c

8条回答
  •  没有蜡笔的小新
    2021-02-05 12:00

    The best way to do this is with a multi layer object.

    • Top: UILabel with opaque background and clear text

      • Clear text is rendered in drawRect: func through complicated masking process
    • Middle: Worker View that is performing a repeating animation moving an image behind the top label

    • Bottom: a UIView that you add the middle and top subview to in that order. Can be whatever color you want the text to be

    An example can be seen here https://github.com/jhurray/AnimatedLabelExample

提交回复
热议问题