-1
我创建了我的第一个iOS7 SDK的应用程序,一个没有Storyboard的“空应用程序”。 状态栏总是覆盖所有其他视图。 因此,我添加了此代码:状态栏在iOS7中没有Storyboard的视图
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone;
但它没有改变。我的完整代码:
- (void)viewDidLoad
{
[super viewDidLoad];
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
self.edgesForExtendedLayout = UIRectEdgeNone;
UIView *v = [[UIView alloc] initWithFrame:CGRectMake(30, 0, 200, 300)];
[v setBackgroundColor:[UIColor greenColor]];
[self.view addSubview:v];
}
你想隐藏(或摆脱)状态栏,或者只是让你的视图正确地位于状态栏的下方? –
状态栏下方的视图,如iOS6上。 – Sony
是您的问题通过回答[此潜在的重复问题](http://stackoverflow.com/questions/18912290/how-to-present-a-view-controller-on-ios7-without-the-status-bar-overlapping )??? –