Change the width of Master in UISplitViewController

前端 未结 16 1753
自闭症患者
自闭症患者 2020-11-28 05:55

The iPad programming guide says that the splitView\'s left pane is fixed to 320 points. But 320 pixels for my master view controller is too much. I would like to reduce it a

16条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 06:42

    In IOS 8.0 you can easily do this by doing the following:

    1. In your MasterSplitViewController.h add

    @property(nonatomic, assign) CGFloat maximumPrimaryColumnWidth NS_AVAILABLE_IOS(8_0);
    

    2. 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.

提交回复
热议问题