简体   繁体   English

将应用程序从 iPhone 迁移到 iPad - 不相同的视图控制器层次结构

[英]Migrate app from iPhone to iPad - Not the same viewcontroller hierarchy

I have search for this question but I have found nothing, so I hope the question is not duplicated.我已经搜索过这个问题,但一无所获,所以我希望这个问题不会重复。

I have a full working iPhone app.我有一个完整的 iPhone 应用程序。 On this app, I have two view controllers like this:在这个应用程序上,我有两个像这样的视图控制器:MainStoryboard-iPhone.storyboard

Favourites is controlled by IVFavouritesViewController and Verb list is controlled by IVFirstViewController .收藏夹由IVFavouritesViewController控制,动词列表由IVFirstViewController控制。 I want to do the same thing on a single iPad view controller, something like this:我想在单个 iPad 视图 controller 上做同样的事情,就像这样:

MainStoryboard-iPad.storyboard

As you can see, I have two table views, also with a UISearchBar like on the iPhone storyboard. So I want to use the iPhone viewControllers on the same view on iPad, by changing them as few as possible.如您所见,我有两个表视图,还有一个 UISearchBar,就像 iPhone storyboard 上的那样。所以我想在 iPad 上的同一视图上使用 iPhone viewController,方法是尽可能少地更改它们。 What will be the best approach?最好的方法是什么?

Thanks in advance!!提前致谢!!

Well you could make a third View controller that acts like a container for the other two.好吧,您可以制作第三个视图 controller,它充当其他两个视图的容器。 It would just have two subviews which are populated with the views from your two existing controllers.它只有两个子视图,其中填充了来自两个现有控制器的视图。

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

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