这是我用来隐藏两者的代码:
- (voID)hIDeTabbar:(UITabbarController *) tabbarcontroller{ [UIVIEw beginAnimations:nil context:NulL]; [UIVIEw setAnimationDuration:0]; if(IS_IPHONE_5) { for(UIVIEw *vIEw in tabbarcontroller.vIEw.subvIEws) { if([vIEw isKindOfClass:[UITabbar class]]) { [vIEw setFrame:CGRectMake(vIEw.frame.origin.x,568,vIEw.frame.size.wIDth,vIEw.frame.size.height)]; } else { [vIEw setFrame:CGRectMake(vIEw.frame.origin.x,vIEw.frame.origin.y,568)]; } } } else { for(UIVIEw *vIEw in tabbarcontroller.vIEw.subvIEws) { if([vIEw isKindOfClass:[UITabbar class]]) { [vIEw setFrame:CGRectMake(vIEw.frame.origin.x,480,480)]; } } } [UIVIEw commitAnimations];}- (voID)showTabbar:(UITabbarController *) tabbarcontroller{ [UIVIEw beginAnimations:nil context:NulL]; [UIVIEw setAnimationDuration:0]; if(IS_IPHONE_5) { for(UIVIEw *vIEw in tabbarcontroller.vIEw.subvIEws) { if([vIEw isKindOfClass:[UITabbar class]]) { [vIEw setFrame:CGRectMake(vIEw.frame.origin.x,519,vIEw.frame.size.height)]; } else { [vIEw setFrame:CGRectMake(vIEw.frame.origin.x,519)]; } } } else { for(UIVIEw *vIEw in tabbarcontroller.vIEw.subvIEws) { if([vIEw isKindOfClass:[UITabbar class]]) { [vIEw setFrame:CGRectMake(vIEw.frame.origin.x,431,431)]; } } } [UIVIEw commitAnimations];}- (voID)hIDeNavbar:(UINavigationController *) navbarController{ [UIVIEw beginAnimations:nil context:NulL]; [UIVIEw setAnimationDuration:0]; [self.navigationController setNavigationbarHIDden:YES]; [UIVIEw commitAnimations];}- (voID)showNavbar:(UINavigationController *) navbarController{ [UIVIEw beginAnimations:nil context:NulL]; [UIVIEw setAnimationDuration:0]; [self.navigationController setNavigationbarHIDden:NO]; [UIVIEw commitAnimations];}
这是我的问题的图像:
非常感谢你的帮助
解决方法 我假设您正在使用ScrollVIEw来呈现照片.我在视图控制器中遇到了类似问题和设置self.automaticallyAdjustsScrollVIEwInsets = NO;
应该有所帮助
总结Default value is YES,which allows the vIEw controller to adjust its scroll vIEw insets in response to the screen areas consumed by the status bar,navigation bar,and toolbar or tab bar. Set to NO if you want to manage scroll vIEw inset adjustments yourself…
以上是内存溢出为你收集整理的ios – 隐藏导航栏和标签栏后,UICollectionView框架发生了变化全部内容,希望文章能够帮你解决ios – 隐藏导航栏和标签栏后,UICollectionView框架发生了变化所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)