Custom size for Modal View loaded with Form Sheet presentation

前端 未结 10 785
予麋鹿
予麋鹿 2021-02-01 12:44

I\'m trying to load a UIViewController in iPad with Form Sheet presentation. The problem is the size of this new view, i put the size values in the IBuilder but the modal view t

10条回答
  •  醉酒成梦
    2021-02-01 13:16

    I got around this problem by putting my content inside a view in the modal vc. Then setting the vc background transparent and in viewWillAppear settings the formsheet background transparent. This means you only see the content.

    // In Modal vc
    - (void)viewWillAppear:(BOOL)animated
    {
        self.view.superview.backgroundColor = [UIColor clearColor];
        [super viewWillAppear:animated];
    }
    

    I set it all from storyboard and used a segue, if using code you would need to set this also.

    parentViewController.modalPresentationStyle = UIModalPresentationPageSheet;
    

提交回复
热议问题