iOS 7 代码布局适配:坐标起点 iOS 7 中 UIViewController 使用了全屏布局的方式,也就是说导航栏和状态栏都是不占实际空间的,状态栏默认是全透明的,导航栏默认是毛玻璃的透明效果。例如在一个 view 中加入:
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,100,100)];
[label setBackgroundColor:[UIColor greenColor]];
[self.view addSubview:label];
上面代码加在没有 UINavigationController 作为 rootViewController 的情况下,得到的效果是: