ios7适配-创新互联

1.状态栏20px高度问题ios7适配
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中设置:

成都创新互联公司专注于桂平企业网站建设,响应式网站设计,商城网站制作。桂平网站建设公司,为桂平等地区提供建站服务。全流程按需规划网站,专业设计,全程项目跟踪,成都创新互联公司专业和态度为您提供的服务

View controller-based status bar appearance = NO;

2.部分页面不能适配的,强制写回

[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 搜索栏隐藏在状态后面

-(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;
        }];
    }
}

文章名称:ios7适配-创新互联
地址分享:https://www.cdcxhl.com/article24/jsjce.html

成都网站建设公司_创新互联,为您提供网站策划手机网站建设品牌网站设计域名注册网站内链移动网站建设

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都定制网站建设