objective c - UISegmented Control Animation / Translation -
i trying translate segmented control vertically when index 0 pressed, uitextview can appear in it's position. have animation uitextview working.
i have tried implement following code this other stackoverflow thread. btnmybutton being replaced mysegcontrol.
btnmybutton.frame = cgrectmake(oldx,oldy,width,height); [uiview beginanimations:nil context:null]; [uiview setanimationtransition:uiviewanimationtransitionnone forview:btnmybutton]; [uiview setanimationduration:0.3]; btnmybutton.frame = cgrectmake(newx, newy, width, height); [uiview commitanimations]; when changed, [uiview setanimationtransition:uiviewanimationtransitionnone forview:presentingcomplaintsegctrl];
gives following warning: "semantic issue class method '+setanimationtransition:forview:' not found (return type defaults 'id')"
is there better way approach this?
note: creating segmented control in xib.
thank you
as warning says, method '+setanimationtransition:forview:' doesn't exist in uiview. method looking '+setanimationtransition:forview:cache:'. however, in documentation there note says:
use of method discouraged in ios 4.0 , later. should use transitionwithview:duration:options:animations:completion: method perform transitions instead.
if don't need support ios 3.x, advise apple says , use method 'transitionwithview:duration:options:animations:completion:' animation :)
[edit]
hey @rĂomhaire, reading question again... example it's best if use animatewithduration:animations: method in uiview. write code changes want animate inside block , pass parameter method. here documentation blocks in case need it: http://developer.apple.com/library/ios/#featuredarticles/short_practical_guide_blocks/_index.html
Comments
Post a Comment