天天看點

[翻譯] JTNumberScrollAnimatedView

jtnumberscrollanimatedview

[翻譯] JTNumberScrollAnimatedView

效果:

[翻譯] JTNumberScrollAnimatedView

use jtnumberscrollanimatedview for have a nice animation for display number. it's easy to use, easy to customize.

使用 jtnumberscrollanimatedview來展示一個效果非常不錯的顯示數字變化的動畫效果的控件,使用很簡單,非常容易定制。

usage

basic usage - 基本的使用

you can use <code>jtnumberscrollanimatedview</code> like a normal view.

你可以像使用一個普通的view一樣來使用jtnumberscrollanimatedview

you just have to call <code>setvalue</code> with a nsnumber and use <code>startanimation</code> for launch the animation.

你隻需要調用setvalue方法然後執行startanimation方法就能顯示效果。

warning - 注意

for now the <code>value</code> must be a positive integer.

現在,這個值必須是正的不能是負數。

customization - 定制

you can easily change some properties of the animation. each caracter have its own <code>column</code>.

你可以很簡單的修改以下的一些屬性

<code>textcolor</code>

<code>font</code>

<code>duration</code>

<code>durationoffset</code>, delay between the end of the animation of each column

<code>density</code>, number of characters by column for the animation

<code>minlength</code>, you can force the minimum count of columns

<code>isascending</code>, the direction of the scroll

if you change one of this properties, you have to call <code>setvalue</code> for update the view.

如果你修改了其中的一個屬性,你需要調用 setvalue 來更新畫面。

requirements

ios 7 or higher                                 ios7 或者更高版本

automatic reference counting (arc)  arc

繼續閱讀