Changing column size of splitviewcontroller ?

Discussion in 'iOS Programming' started by whitedragon101, Feb 20, 2015.

  1. whitedragon101, Feb 20, 2015
    Last edited: Feb 21, 2015

    whitedragon101 macrumors 65816

    Sep 11, 2008
    The split view controller has a two column layout the master column on the left and the detail on the right. I want to be able to set the width of the columns.

    I came across this solution in stack overflow. It works but does not respond to numbers over 410 which means I can't make the split 50/50. Any ideas why it is limiting me and how I get around it? Thanks

    edit: This is an iPad only project not iPhone

    From stack overflow

    In IOS 8.0 you can easily do this by doing the following:
    In your MasterSplitViewController.h add
    @property(nonatomic, assign) CGFloat maximumPrimaryColumnWidth NS_AVAILABLE_IOS(8_0);
    In your MasterSplitViewController.m viewDidLoad method add
    self.maximumPrimaryColumnWidth = 100; self.splitViewController.maximumPrimaryColumnWidth = self.maximumPrimaryColumnWidth;
    This is a really good, simple and easy feature of IOS 8.
  2. whitedragon101 thread starter macrumors 65816

    Sep 11, 2008

Share This Page