Rodrigo Chavarria
Rodrigo Chavarria

Reputation: 37

xamarin c# work with two storyboards one for iPad and another for iPhone?

Im developing an app and I want to use one storyboard for iPhone things and another for iPad thing, is it possible? where I have to define it?

Upvotes: 2

Views: 390

Answers (2)

SushiHangover
SushiHangover

Reputation: 74174

In the Info.plist, there is a key called UIMainStoryboardFile.

By default, that is assigned to Main, your Universal storyboard.

There are two more string-based keys available that can be added and assigned to different storyboards:

  • UIMainStoryboardFile~ipad
  • UIMainStoryboardFile~iphone

Info.plist example:

~~~
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIMainStoryboardFile~ipad</key>
<string>iPadStoryboard</string>
<key>UIMainStoryboardFile~iphone</key>
<string>iPhoneStoryboard</string>
~~~

Note: Make sure that the UIViewController in each of the Storyboards is set as Is Initial View Controller otherwise they will not show up by default when the app runs.

Upvotes: 1

Justinfailber
Justinfailber

Reputation: 38

Image

Open the properties of your iOS project. Select under devices: Universal. And you can select 2 storyboards, one for iPhone/iPod and one for iPad.

Upvotes: 1

Related Questions