简体   繁体   English

iPad中的分屏

[英]Split screen in iPad

I working on a iPAD only app which requires me to split the screen such a way that: 我在仅使用iPAD的应用程序上工作,该应用程序要求我以以下方式拆分屏幕:

(1) there are 2 parts on the screen divided vertically (1)屏幕上有2个部分,垂直分割

(2) On the left side, user can communicate using a chat (2)在左侧,用户可以使用聊天进行交流

(3) On the right side, user can see continuous streaming data (3)在右侧,用户可以看到连续的流数据

I am not sure (A) how can I do two tasks simultaneously (B)how to split the screen (is Split view the way to achieve both of these?) 我不确定(A)如何同时执行两个任务(B)如何拆分屏幕(拆分视图是同时实现这两项的方法吗?)

Thank you. 谢谢。

A splitViewController is great for having two view controllers (or rather the views that belong to them) onscreen at the same time. splitViewController非常适合同时显示两个视图控制器(或更确切地说,属于它们的视图)。 Usually you see this for master-detail apps, where left you get a table view in which you select a row that gets displayed in detail on the right. 通常,对于主从应用程序您会看到此信息,在左侧您会看到一个表格视图,在表格视图中您选择了在右侧详细显示的行。 Nothing stops you from using this in your own way. 没有什么能阻止您以自己的方式使用它。

Take RootViewController and inside its 取RootViewController并放在其内部
-(void)viewDidLoad:
UIView *viewOne = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 512, 768)];
UIView *viewTwo = [[UIView alloc]initWithFrame:CGRectMake(512, 0, 512, 768)]; [[self view]addSubview:viewOne];
[[self view]addSubview:viewTwo];

And you can add anything inside viewOne or viewTwo. 您可以在viewOne或viewTwo中添加任何内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM