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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -