Reputation: 5579
I want to make one view which will contain different UI for iPad and iPhone but both will use the same ViewController.
Will it be possible?
If Yes then how?
Upvotes: 0
Views: 156
Reputation: 14463
Double click the xib,select file's owner class as your viewcontroller.
Override LoadView
method in your viewcontroller.
public override void LoadView()
{
base.LoadView();
if (UIDevice.CurrentDevice.Model == "iPad")
{
string xibName = "ViewController1~ipad";
UIView v = UINib.FromName(xibName, null).Instantiate(null, null)[0] as UIView;
View.Add(v);
}
}
Then you see two different xib can be displayed on different platforms.
Upvotes: 1