iPhone X設(shè)配問(wèn)題總結(jié)一

一、 iPhone X跳轉(zhuǎn)push到下一個(gè)界面的時(shí)候tabBar上移了

  • 解決方案:
  • 在UINavigationController的子類(lèi)集成父類(lèi)push方法里改變tabBar的高度
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if (self.childViewControllers.count > 0) {
       viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"v1_left_item"] style:UIBarButtonItemStyleDone target:self action:@selector(back)];
        viewController.hidesBottomBarWhenPushed = YES;
    }
    [super pushViewController:viewController animated:YES];
    CGRect frame = self.tabBarController.tabBar.frame;
    frame.origin.y = [UIScreen mainScreen].bounds.size.height - frame.size.height;
    self.tabBarController.tabBar.frame = frame;
}

二、app在iPhoneX中不能全屏顯示問(wèn)題

  • 上下是多余的黑條如圖:


    非全屏效果
  • 解決方案:
  • xcode版本9以上是硬性要求,你會(huì)發(fā)現(xiàn)在啟動(dòng)圖里面多了一個(gè)位置iPhone X,@3x像素要求1125*2436,把這個(gè)圖填上就可以
  • iPhone5/6/7/8都用這個(gè)的啟動(dòng)圖像素1125*2436,自動(dòng)全屏顯示,親測(cè)有效
啟動(dòng)圖
全屏顯示效果
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容