开发者

iPad UISplitView question for Universal App

开发者 https://www.devze.com 2023-02-01 06:58 出处:网络
I am attempting to turn an iPhone app into a Universal App with a simple UISplitView for the iPad. I have added the following to the App Delegate:

I am attempting to turn an iPhone app into a Universal App with a simple UISplitView for the iPad. I have added the following to the App Delegate:

> if (UI_USER_INTERFACE_IDIOM() ==
> UIUserInterf开发者_Go百科aceIdiomPad) {
>         [window addSubview:splitViewController.view]; 
>         [window makeKeyAndVisible];
>     } else {
>         [window addSubview:tabBarController.view]; 
>         [window makeKeyAndVisible];
>     }

However, it doesn't give me the option in IB to add a UISplitViewController in the MainWindow.nib. So, after creating a new nib and adding the App Delegate object, I linked up a SplitViewController with the splitView that I declared in the App delegate - however when I try to run it on the iPad simulator, it is still showing up as an iPhone App running on an iPad. (@ 1/2 size) Any thoughts?


This sounds like an issue with your Project/Build settings rather than code at this point.

Select your Target, choose Get Info and make sure your Targeted Device Family is set to iPad/iPhone on all your build configurations, then do a clean build and try again.

0

精彩评论

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

关注公众号