适用于iphone的UISplitViewController [英] UISplitViewController for iphone

查看:110
本文介绍了适用于iphone的UISplitViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个iPhone(而非iPad)应用程序,其分屏视图在同一屏幕上显示两个视图控制器,一个在屏幕左侧,另一个在屏幕右侧(仅限风景)。

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).

有没有办法让UISplitViewController适用于iPhone,或者是否有可以用来实现这种外观的开源库?

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没那么有用 - 你可以很容易地模仿它们的效果。

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

这篇关于适用于iphone的UISplitViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆