2

how to implement right panel slide effect like following picture? when click left area, the right panel is hidden.

picture url http://cdn.thenextweb.com/wp-content/blogs.dir/1/files/2012/02/photo.png

I think

  1. it is not popover controller.
  2. is it a view added by using "addSubview"? I don't think so because it is a navigation controller,it seems that view in navigation controller can't be added by using addsubview
  3. is it a modal view? if yes, how to implement semi transparent background? if use UIModalPresentationCurrentContext to present modal view, parent view can't rotate when ipad is rotated.

Any help is highly appreciated! Thanks.

Tomson
  • 163
  • 2
  • 9

1 Answers1

0

These are all likely highly customized view controllers, and view controller containers.

You can fully control the presentation of your view controllers by adding them as children of another view controller, and adding their views to the view tree manually -- using any animation you choose.

The dimming effect you see can be achieved by overlaying a "dimming view", for example a black 50% opaque view.

  • Thanks Brian, but how to add a view (which is in navigation controller) as a children to another view? – Tomson May 30 '12 at 08:24
  • To add navigation controller as a subview, I tried codes in the post http://stackoverflow.com/questions/2526990/adding-a-uinavigationcontroller-as-a-subview-of-uiview. it works fine in iOS 5, but not in iOS 4.3 – Tomson May 30 '12 at 08:57
  • Container view controllers are new in 5.0. Prior to 5 you'll need to do more work to forward various view controller life cycle methods on your own (calling viewWillAppear etc) – Brian Tunning May 30 '12 at 14:36
  • I think I will use animation to simulate navigation controller switch view effect. Thanks for your tips! – Tomson May 31 '12 at 02:38