ios 7 UiView frame issue

时光怂恿深爱的人放手 提交于 2019-12-02 16:37:28

You should use below line for fix it in your view.

 self.edgesForExtendedLayout = UIRectEdgeNone;

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 ;

In iOS 7, view controllers use full-screen layout. it is mentioned in iOS 7 UI Transition Guide

if you want change the layout use edgesForExtendedLayout property

example:

   if([UIViewController instancesRespondToSelector:@selector(edgesForExtendedLayout)])

        self.edgesForExtendedLayout=UIRectEdgeNone;

I had a similar issue myself and found that if you turn off the translucency of the navigation bar the views will drop down the same as they did in iOS6.

self.navigationController.navigationBar.translucent = NO;

At the time of this answer, iOS 7 was still under NDA, so it was not possible to write the actual solution. To help anyway, I've posted a helping link available only for registered developers.

==== Original Post: ====

Read the iOS 7 Transition Guide. Its section 'Updating the UI' explains how to fix your problem.

if([self respondsToSelector:@selector(edgesForExtendedLayout)])
    [self setEdgesForExtendedLayout:UIRectEdgeBottom];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!