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 搜索欄隱藏在狀態(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;
}];
}
}
文章名稱:ios7適配-創(chuàng)新互聯(lián)
地址分享:http://vcdvsql.cn/article24/jsjce.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、手機網(wǎng)站建設、品牌網(wǎng)站設計、域名注冊、網(wǎng)站內鏈、移動網(wǎng)站建設
聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內容