ios 8 change the size of presented/modal view controller

前端 未结 3 702
执念已碎
执念已碎 2020-12-14 04:27

In ios 7 and before, I was updating the bounds of presentedViewController.view.superview to custom the size of presented view controller, but it seems this would not be the

3条回答
  •  暖寄归人
    2020-12-14 05:09

    Instead of subclassing you can use the preferredContentSize property

    - (void)viewDidLoad {
       [super viewDidLoad];
    
       self.preferredContentSize = CGSizeMake((self.view.frame.size.width / 100) * 65, (self.view.frame.size.height / 100) * 65);
    }
    

提交回复
热议问题