iphone - How do you animate the layout of the UI elements in a custom view of an iOS app? -


i'd build preferences screen in ios app has segmented control @ top and, depending on state, determine sliders , switches visible, they're positioned. when change state of segmented control , layout of screen changes, i'd animate smoothly new layout. example of kind of behavior can seen in the wireless settings of ios device, click around on various segmented controls, can see layout animating.

  1. i understand how hide , reposition controls, how animate it? i'm used specifying "yes" "willanimate" parameter, these hide , reposition functions don't include it.
  2. in interface builder, how should create multiple layouts of controls in single view? position controls on top of each other?

thanks in advance help!

1) this:

    [uiview beginanimations:nil context:nil];     [uiview setanimationduration:1]; //1 sec duration     [uiview setanimationdelegate:self];     [uiview  setanimationdidstopselector:@selector(mytransitiondidstop:finished:context:)];             //what want animate goes here.....      [uiview commitanimations]; 

also, mytransitiondidstop:finished:context: callback method executed after animation completed. should optional.

2) yes, hide elements. determine @ runtime ones display.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -