ios 7 UiView frame issue

前端 未结 6 1620
渐次进展
渐次进展 2021-01-31 03:26

I am running same app in iOS6 and iOS7 which has NavigationBar.It runs well on iOS6, but in iOS7, all view is little bit up like it is not considering the Navigation bar at all.

6条回答
  •  梦毁少年i
    2021-01-31 03:41

    In "iOS 7 UI Transition Guide" for Layout and Appearance one also mentioned - in iOS7 in, view controllers use the full screen layout.

    If we want the view shows the following location from the navigation bar, you can modify the UIViewController's edgesForExtendedLayout this property to achieve.

    edgesForExtendedLayout is a type UIExtendedEdge attribute that specifies the direction of the edge to be extended.

    Because iOS7 encourage full screen layout, its default value is natural to be UIRectEdgeAll, both extending around the edge, that is, if there is even the view navigationBar, under tabBar, then the view will extend coverage to the surrounding area.

    If we make the following settings view, then the view will not be extended to those behind the bar, so label came out. View Source Print

    self . edgesForExtendedLayout = UIRectEdgeNone ;
    

提交回复
热议问题