我有一個全局變量p。 我有一個函數根據這個全局變量的值繪製(或重繪)我複雜的UIView對象。 當我增加p時,我的uiview對象需要重繪。我需要使用動畫來完成。動畫ios objective-c
double pInitialValue=0.5;
double pNewValue=1.0;
//somewhere before animation we must call [self redraw] to draw our view with p=pInitialValue;
//then, when we call animate function.
//we change p to pNewValue
//and every step must be redrawed using [self redraw]
p=pNewValue; //using animation p must slowly grow from pInitialValue to pNewValue
[self redraw]; //and ofcourse user must see every step of animation so we need to call redraw function
比如我需要時間4 動畫這意味着,這家4秒鐘內我的p必須從pInitialValue增長到pNewValue,並在每一步我重繪函數必須被調用
幫幫我,請。如何做呢?
您是否聽說過標準UIView動畫?他們只需幾行代碼即可完成所有任務。 –