Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS-Masterviewcontroller does not show up

I've been struggling with a very strange problem. In my iPad storyboard I drag a UISplitViewController. To the detail view controller I put a UIImage and set its image to an image. And I do the same thing to the master view controller. I do this just to see both master and detail view controllers display in landscape mode. But when I launch the app in iPad simulator, only the detail view controller captures the whole screen area and master does not show up. I tried setting the orientation of the split view controller to Landscape so that make it start in landscape mode but that did not help. I know I'm missing something here. What is that? Thank you in advance.

like image 260
Mikayil Abdullayev Avatar asked Aug 28 '26 06:08

Mikayil Abdullayev


1 Answers

Found the problem. It seems I have to set both master and detail view controllers to support certain orientations. It means just dragging a view controller to the the storyboard, making it the detail/master view controller and putting an image inside won't work. We have to create a subclass of UIViewController and set the classes in the storyboard to these newly created UIViewController custom subclasses. It's because we need to implement shouldAutoRotate... method in both view controllers.

like image 156
Mikayil Abdullayev Avatar answered Aug 30 '26 08:08

Mikayil Abdullayev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!