Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISplitViewController for iphone

I want to create an iPhone (not iPad) app with a split screen view that shows two view controllers on the same screen, one on the left and one on the right of the screen (landscape only).

Is there a way to make UISplitViewController work for iPhone, or is there an open source library i can use to achieve this look?

like image 472
adamsiton Avatar asked Mar 09 '26 16:03

adamsiton


2 Answers

As said, you can not use a split view controller. However, I dont think you need it anyway. Its a little cumbersome and restrictive.

You can achieve the effect of the split view controller easily using subviews. (Try to avoid using multiple view controllers as this is generally bad practice).

Create two custom views and ad them as sub views to the main view. Look at their auto resizing properties. Try to use interface builder. Show / hide you side view when the user rotates.

UISplitViewControllers aren't that useful - you can mimic their effectes easily.

like image 179
Robert Avatar answered Mar 12 '26 05:03

Robert


There is no way you can achieve this using the UISplitViewController class. If you take a look at the Apple reference documents it clearly states that the UISplitViewController is an iPad-specific viewcontroller.

Note this point

If you are developing a universal application, though, be sure not to create and use these controllers when your application is running on an iPhone or iPod touch.

like image 41
visakh7 Avatar answered Mar 12 '26 06:03

visakh7