Since the translucent property of the IOS7 navigation Controller navigation control bar defaults to Yes, there are times in the project where you will always encounter problems with the view controller's root view location. For example, in the Rootviewcontroller of the navigation controller, you will find that if you
-(void) viewdidload
{
NSLog (@ "%f", self.view.bounds.size.height);
}
You'll find that the value is 568.
The 0 point on which you add a view's coordinate Y value is also the top of the screen.
But why is it that we add a scrolling view of TableView to the root view and then navigate to the bottom of the bar?
This is due to the addition of a property self.automaticallyadjustsscrollviewinsets default Yes after ios7sdk, which means that the SDK uses this property to change the Tabelview offset value
Change the self.automaticallyadjustsscrollviewinsets value to no; It's starting from 0 o'clock.
If we set the self.navigationController.navigationBar.translucent to no then the 0 point is starting from the 64 position, which is the navigation bar, but at this point the height of self.view is still 568;
But if Viewcontroller is not the rootviewcontroller of the navigation controller,
-(void) viewdidload
{
NSLog (@ "%f", self.view.bounds.size.height);
} value is 568;
and
-(void) Viewwillappear: (BOOL) animated
{
NSLog (@ "%f", self.view.bounds.size.height);
The value is 504 (if the self.navigationController.navigationBar.translucent is no;
This is a very headache problem, why and Rootviewcontroller results are not the same, do not know is not xcode bug?
So be cautious when you use it, and be careful about it.
IOS 7 The things that have sekine view height and position after using the navigation controller