UIView doesn't resize to full screen when hiding the nav bar & tab bar

后端 未结 15 1564
情歌与酒
情歌与酒 2020-12-02 07:28

I have an app that has a tab bar & nav bar for normal interaction. One of my screens is a large portion of text, so I allow the user to tap to go full screen (sort of l

15条回答
  •  春和景丽
    2020-12-02 08:13

    If you are using Interface Builder, ensure autoresizing is set properly in the Size Inspector. If you creating the UITextView in code, make sure you set the frame to be large enough and that the view's parent (and it's parent) are also large enough. For simplicity, add the view to the window directly, and then move inward from there.

    To move a view to its superview:

    - (void)moveViewToSuperview:(UIView *)view
    {
        UIView *newSuperview = [[view superview] superview];
        [view removeFromSuperview];
        [newSuperview addSubview:view];
        [newSuperview bringSubviewToFront:view];
    }
    

提交回复
热议问题