How to correct Tab Bar height issue on iPhone X

前端 未结 20 3430
长发绾君心
长发绾君心 2020-12-13 13:07

I\'m having an issue with my app when testing for iPhone X. I\'m not sure how to adjust this issue, as well as not make it an issue for non iPhone X sizes. This only seems t

相关标签:
20条回答
  • 2020-12-13 13:55

    For iOS 11.3 this worked for me:

    func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        tabBar.invalidateIntrinsicContentSize()
    }
    
    0 讨论(0)
  • 2020-12-13 13:57

    This worked for me as I am using a selection image.

    tabBar.selectionIndicatorImage = UIImage.imageWithColor(color: UIColor.NewDesignColor.yellow, size: tabBarItemSize).resizableImage(withCapInsets: UIEdgeInsets.init(top: 0, left: 0, bottom: 20, right: 0))
    

    Adding a bottom inset helps in my case. Hope this works for your as well. Thanks.

    0 讨论(0)
提交回复
热议问题