封装一个方法 每次去隐藏或者显示导航栏的时候 就调用这里就可以了
将坐标原点设置为(0,0)
- (void)setNavigationState:(BOOL)state{
if (state) {
self.edgesForExtendedLayout=UIRectEdgeBottom;
}
else{
self.edgesForExtendedLayout=UIRectEdgeTop;
}
self.navigationController.navigationBar.translucent = YES;
[self.navigationController setNavigationBarHidden:state animated:YES];
}