问题
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?
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/7346819/uisplitviewcontroller-for-iphone