当前位置: 移动技术网 > IT编程>移动开发>IOS > iOS11&iPhoneX适配&Xcode9打包注意事项

iOS11&iPhoneX适配&Xcode9打包注意事项

2019年07月24日  | 移动技术网IT编程  | 我要评论

李欣照片,网络公司实习报告,北京站到北京西站

1,适配uitableview

if#available(ios11.0, *) {
self.contentinsetadjustmentbehavior= .never
self.estimatedrowheight=0
self.estimatedsectionheaderheight=0
self.estimatedsectionfooterheight=0
}else{
}

2,适配uiscrollview

if#available(ios11.0, *) {
scrollview?.contentinsetadjustmentbehavior= .never
}else{
}

3,uitableview中的sectionheader或者footer显示不正常

还有的发现某些界面tableview的sectionheader、sectionfooter高度与设置不符的问题,在ios11中如果不实现-tableview: viewforheaderinsection:和-tableview: viewforfooterinsection:,则-tableview: heightforheaderinsection:和- tableview: heightforfooterinsection:不会被调用,导致它们都变成了默认高度,这是因为tableview在ios11默认使用self-sizing,tableview的estimatedrowheight、estimatedsectionheaderheight、estimatedsectionfooterheight三个高度估算属性由默认的0变成了uitableviewautomaticdimension,解决办法简单粗暴,就是实现对应方法或把这三个属性设为0。

4,适配网页加载不全下面有白边

if#available(ios11.0, *) {
webview.scrollview.contentinsetadjustmentbehavior= .never
}else{
}

5,适配iphonex不能铺满屏的问题

<1>给brand assets添加一张1125*2436大小的图片

打开assets.xcassets文件夹,找到brand assets

右键show in finder

添加一张1125*2436大小的图片

<2>修改contents.json文件,添加如下内容

{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "2436h",
"filename" : "1125_2436.png”,
"minimum-system-version" : "11.0",
"orientation" : "portrait",
"scale" : "3x"
}

6,适配iphonex

//适配iphonex
letll_iphonex = (kscreenw == double(375.0) && kscreenh == double(812.0) ?true:false)
letknavibarh = ll_iphonex ? double(88.0) : double(64.0)
letktabbarh = ll_iphonex ? double(49.0+34.0) : double(49.0)
letkstatusbarh = ll_iphonex ? double(44.0) : double(20.0)

7,xcode9打包注意事项

xcode9打包版本只能是8.2及以下版本,或者9.0及更高版本

xcode9不支持8.3和8.4版本

xcode9新打包要在构建版本的时候加入1024*1024 appsore icon

总结

以上所述是小编给大家介绍的ios11&iphonex适配&xcode9打包注意事项,希望对大家有所帮助

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网