Duck
Duck

Reputation: 35933

iOS - changing the size of the masterViewController

I am using Xcode UISplitViewController default template to create an application.

My app will be landscape only.

I would like to make the masterViewController wider... 400 px, for example. I want it to be always that width.

I do this on the initWithNib.

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.title = NSLocalizedString(@"Cars", @"");
        self.clearsSelectionOnViewWillAppear = NO;
        self.contentSizeForViewInPopover = CGSizeMake(400.0, 600.0);
    }
    return self;
}

But it continues to be 320 px wide, as created by the template.

As far as I googled around, this seems impossible to do. Is this really impossible to change the width of the masterViewController when shown in landscape (in popover ?)

I have also tried to add this in a viewWillAppear and viewDidAppear without success:

[self setContentSizeForViewInPopover:CGSizeMake(400.0, 600.0)];

thanks

Upvotes: 0

Views: 143

Answers (1)

Stephen
Stephen

Reputation: 1437

This is not possible using the built in splitviewcontroller. I would recommend looking up "MGSplitViewController" which will have the functionality you are looking for

Upvotes: 1

Related Questions