IPhone - After dismissing Modal View Controller - gap is left at top of page

后端 未结 16 854
暖寄归人
暖寄归人 2020-12-24 07:07

When starting the app, if the user doesn\'t have login information stored, I want to display a modal view controller to force the entry of this information. I found through

16条回答
  •  一生所求
    2020-12-24 07:40

    I ran into the same issue. Not sure what causes it, but I fixed it with the following line of code just after I dismiss my modal view:

    [self.view setFrame:CGRectMake(0, 10, self.view.frame.size.width, self.view.frame.size.height)];
    

    Just adjust the Y offset to meet your needs. In another instance I had to make it 20 instead of 10.

提交回复
热议问题