tags:

views:

225

answers:

2

is it possible to have a common view for both master and detail view controllers.

What if I need to add a header image(at top, the very first view) common for both the master and detail view controllers. When the device is in the portrait mode the width of the header image view has to shrink to fit to the detail view controller's view and when the orientation changes to landscape the width of the same header image view has to be expanded that is the width of it has to be 1024. Please tell me whether doing this is possible. or any workaround for this?

A: 

I'm not sure about this, but you may need to explicitly set the image using a UIImageView in your DetailViewController and your RootViewController NIB. Then, during an Orientation change (Portrait -> Landscape), the UIImageView in the DetailViewController should automatically flip with the rest of the ViewController, giving you what you are looking for.

Tilo Mitra
A: 

A splitViewController must be root view controller in your application. If you add splitViewController's view as a subview of some other viewController's view, splitViewController will not get the rotation events.

For your problem, change the design of your app so that the common view appears only in detailViewController part so that it will appear in portrait mode also.

If this is not feasible, the only option you are left with is to create your own splitViewController, so that you will be capable of adding it over some other views and send the rotation events to this splitViewController when rotation occurs.

Raj