iOS8 unable to re-size the modal form sheet after changing the orientation

后端 未结 1 476
梦如初夏
梦如初夏 2021-02-06 12:44

Actually what i am doing is on iPad i am presenting the modal form sheet with my own size (520 X 400). It was working fine at first time. Then when i do rotat

1条回答
  •  粉色の甜心
    2021-02-06 13:04

    finally i figure out a way how to resolve the above one.

    Here my solution:

    on ios8 just setting the following property to your modal view will resolve the issue

    in view did load:

    CGRect rect = self.navigationController.view.superview.bounds;
    rect.size.width = 605;
    rect.size.height = 350;
    self.navigationController.view.superview.bounds = rect;
    self.navigationController.preferredContentSize = CGSizeMake(605, 350);
    

    before presenting your modal view

    your_modal_view.preferredContentSize = CGSizeMake(540.0f, 620.0f) //what ever the size you want
    

    I hope this helps

    0 讨论(0)
提交回复
热议问题