iOS7之后视图被导航栏遮挡问题
来源:互联网 发布:淘宝怎么修改好评价 编辑:程序博客网 时间:2024/06/06 07:30
在开发iOS7的界面的时候,有时候你会发现UIViewController里的subView有时会被导航栏遮盖,原因是iOS7鼓励全屏布局,UIViewController中的self.view的坐标原点是从导航栏的原点开始算起。
解决办法:
方法1.设置self.window的frame时用applicationFrame
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch.// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] <span style="color:#3366ff;">bounds</span>]]; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] <span style="color:#3366ff;">applicationFrame</span>]]; if(![[NSUserDefaults standardUserDefaults] boolForKey:@"firstLaunch"]) { [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"firstLaunch"]; GuideViewController *guideViewController = [[GuideViewController alloc] init]; _window.rootViewController = guideViewController; [_window makeKeyAndVisible]; } else { // 首次进入判断是否已登录 // 1.未登录进入注册界面 // 2.已登录进入主界面 if (/* DISABLES CODE */ (1)) { RegistViewController *registVC = [[RegistViewController alloc] init]; self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:registVC]; [self.window makeKeyAndVisible]; } else { [self openMain]; } } return YES;}
方法2.在viewDidLoad里面加上下面的方法
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. if( ([[[UIDevice currentDevice] systemVersion] doubleValue] >= 7.0)) { self.edgesForExtendedLayout = UIRectEdgeNone; self.extendedLayoutIncludesOpaqueBars = NO; self.modalPresentationCapturesStatusBarAppearance = NO; }}
0 0
- iOS7之后视图被导航栏遮挡问题
- ios7 view被导航栏遮挡问题的解决
- ios7 view被导航栏遮挡问题的解决
- iOS处理导航栏遮挡视图问题
- IOS7之后的导航栏遮盖问题
- iOS7之后的导航栏遮盖问题
- ios7之后导航栏的问题1
- ios7之后导航栏的问题2
- iOS7 之后 tableView被navigationBar遮挡 问题详解
- xcode5 ios7 后状态栏被导航栏遮挡的解决方案
- xcode5 ios7 后状态栏被导航栏遮挡的解决方案
- 导航栏控制器遮挡视图
- ios7之后导航栏状态栏小记
- 升级xcode5 ios7 后状态栏被导航栏遮挡的解决方案
- iOS导航栏遮挡问题的总结
- ios 弹出视图全屏遮盖 与 ios7以后的导航栏遮盖view问题
- ios7适配 通知栏UINavigationBar遮挡view的问题
- iOS7适配——导航栏问题
- HTTP协议
- Android Bitmap 与 Drawable之间的区别和转换
- [动态规划]整数拆分(纯DP)
- TCP/IP Monitor 使用总结
- 用dataGridView实现增删改查
- iOS7之后视图被导航栏遮挡问题
- ios D-U-N-S Number(邓白氏编码)申请
- 代理的阶段性小结
- CF581C用k去把n个数补成十的整数倍求最大
- 如何在Mac OS X上安装 Ruby运行环境
- Android MQTT协议和服务器的安装
- linux命令行练级攻略
- 如何隐藏RibbonBar的QAT QuickAccessToolBar
- Building OpenJdk7 in Ubuntu14.10 ( amd64 )