Storyboard app run on iOS 7 OK but Navbar shift view on iOS 6.1

十年热恋 提交于 2019-12-03 11:38:49

You are facing problem because of co-ordinate system, co-ordinate system of iOS 6 & iOS 7 are different iOS 7 Uses by default translucent properties.

Try putting this Code in viewDidLoad

if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1)
{
     self.edgesForExtendedLayout=NO;
}

I think this is because of co-ordinate system of iOS 6 & iOS 7

Kindly check following two images.

iOS 6:

iOS 7 :

As I said in the comment: in IB (interface builder), you need to go to the "Attribute Inspector" for the view controller, and look at the "Extend Edges" attribute: simply uncheck the "Under Top Bar" flag and you're done.

In interface builder, in the size inspector tab, there is a section called iOS 6/7 Delta where you can fix navigation bar issue or when some control have different size in ios7 than in ios6.

You have to do two things :-

a. select that particular xib or view in storyboard and see on right pane there is extended edges option unlcik first option. now this would shift your view down perfectly.

b.all the contents inside this view will also get shifted below for that you have to set delta factor -(x pixels) for ios7 and +(pixels) for ios6. For setting 6 and 7 you have to select "view as" option in right pane of xib.

Happy coding

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