UISplitViewController for iphone

你说的曾经没有我的故事 提交于 2019-12-22 10:10:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!