if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7)
{
[application setStatusBarStyle:UIStatusBarStyleLightContent];
self.window.clipsToBounds=YES;
self.window.frame= CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
//added on 19th Sep self.window.bounds = CGRectMake(0, 20, self.window.frame.size.width, ScreenHeight-20);
}
工程Plist中設(shè)置:
成都創(chuàng)新互聯(lián)公司專注于桂平企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站設(shè)計(jì),商城網(wǎng)站制作。桂平網(wǎng)站建設(shè)公司,為桂平等地區(qū)提供建站服務(wù)。全流程按需規(guī)劃網(wǎng)站,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,成都創(chuàng)新互聯(lián)公司專業(yè)和態(tài)度為您提供的服務(wù)View controller-based status bar appearance = NO;
2.部分頁面不能適配的,強(qiáng)制寫回
[self.view setBounds:CGRectMake(0, -20, self.view.bounds.size.width, self.view.bounds.size.height)];
3.
if (systemVersion >= 7.0)
{
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars= NO;
self.modalPresentationCapturesStatusBarAppearance= NO;
}
4 搜索欄隱藏在狀態(tài)后面
-(void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
CGRect statusBarFrame= [[UIApplication sharedApplication] statusBarFrame];
[UIView animateWithDuration:0.25 animations:^{
for (UIView *subview in self.view.subviews)
subview.transform= CGAffineTransformMakeTranslation(0, statusBarFrame.size.height);
}];
}
}
-(void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller {
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
[UIView animateWithDuration:0.25 animations:^{
for (UIView *subview in self.view.subviews)
subview.transform= CGAffineTransformIdentity;
}];
}
}