开发者

UISplitViewController for iphone

开发者 https://www.devze.com 2023-04-03 06:50 出处:网络
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 (lan开发者_开发问答dscape only

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 (lan开发者_开发问答dscape 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?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消