Container View getting pushed down as if it had a UINavigationBar?

前端 未结 8 986
既然无缘
既然无缘 2020-12-08 06:13

I have a UIViewController with a Container View. This Container View contains a UITableViewController.

The UIViewController is embedded in a UINavigationController.

8条回答
  •  伪装坚强ぢ
    2020-12-08 07:07

    As of iOS 7.0, all views automatically go behind navigation bars, toolbars and tab bars to provide what Apple calls "context" – having some idea of what's underneath the UI (albeit blurred out with a frosted glass effect) gives users an idea of what else is just off screen.

    If this is getting in your way (and honestly it does get in the way surprisingly often) you can easily disable it for a given view controller by modifying its edgesForExtendedLayout property.

    For example, if you don't want a view controller to go behind any bars, use this:

    edgesForExtendedLayout = []

    Available from iOS 7.0

    Source

提交回复
热议问题