swift - 为什么 UITabBar 在 iOS 13 中工作异常?
问题描述
我有使用 swift 4.2 处理 UITabBarItem 的代码。只有当该页面已被购买时才能打开。这是我的代码
func setupTabBar(){
tabBarItems = tabBar.items
if(typePage == "ばんそう"){
self.selectedIndex = 0
if(pageInfo?.pdfFiles == ""){
tabBarItems![1].image = UIImage(named: "ic_cross_gray")
tabBarItems![1].title = "ドリル"
} else {
if !IAPHandler.instance.lockHandler(isDrill: true, bookType: IAPHandler.instance.typeFilter(type: titleNav)!) {
tabBarItems![1].image = UIImage(named: "ic_lock")
tabBarItems![1].title = "ドリル"
}
}
} else if(typePage == "ドリル") {
self.selectedIndex = 1
if(pageInfo?.song.count == 0){
tabBarItems![0].image = UIImage(named: "ic_cross_gray")
tabBarItems![0].title = "ばんそう"
} else {
if !IAPHandler.instance.lockHandler(isDrill: false, bookType: IAPHandler.instance.typeFilter(type: titleNav)!) {
tabBarItems![0].image = UIImage(named: "ic_lock")
tabBarItems![0].title = "ばんそう"
}
}
}
}
该功能运行良好。但是 UI iOS 13 有一个错误。这是 iPhone 6 和 iOS 12 的屏幕截图。
但是当我在带有 iOS 13 的 iPhone X 上运行时,这很奇怪。相同的代码,相同的一切,只是在不同的设备上运行。
解决方案
推荐阅读
- r - 带有多个变量的误差线的 R 条形图
- node.js - 网络错误 AWS SES
- python - babelnet API - 使用请求和 JSON 模块的编码错误
- performance-testing - 平均第 90 个百分位响应时间和平均响应时间
- django - django 模型来模拟“has-a”和“contains”关系
- php - Laravel 多变量子子域
- javascript - 使用 Highcharts 中的更新方法启用/禁用 Boost
- inheritance - Kotlin - 委托而不是单例中的继承
- r - 根据所属组的字母顺序重新排列 x 轴名称
- facebook - 我的 Facebook 流媒体代码不再工作,FB 想要用户点击上线,页面管理可能在视频拍摄时不可用