为什么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上有一个错误。 这是带有iOS 12的iPhone 6中的屏幕截图。

为什么UITabBar在iOS 13中怪异地工作?

但是当我在装有iOS 13的iPhone X上运行时,这很奇怪。 相同的代码,相同的所有内容,仅在不同的设备上运行。

为什么UITabBar在iOS 13中怪异地工作?

cc8562698 回答:为什么UITabBar在iOS 13中怪异地工作?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3126494.html

大家都在问