iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

前端 未结 30 2447
误落风尘
误落风尘 2020-11-29 17:05

Anyone having issue with the iPhone X simulator around the UITabBar component?

Mine seem to be rendering the icons and title on top of each other, I\'m not sure if I

相关标签:
30条回答
  • 2020-11-29 17:54

    I had the same problem.

    If I set any non-zero constant on the UITabBar's bottom constraint to the safe area:

    It starts working as expected...

    That is the only change I made and I have no idea why it works but if anyone does I'd love to know.

    0 讨论(0)
  • 2020-11-29 17:54

    Select tabbar and set "Save Area Relative Margins" checkbox in Inspector Editor like this:

    0 讨论(0)
  • 2020-11-29 17:54

    I was using a UITabBarController in the storyboard and at first it was working alright for me, but after upgrading to newer Xcode version it started giving me issues related to the height of the tabBar.

    For me, the fix was to delete the existing UITabBarController from storyboard and re-create by dragging it from the interface builder objects library.

    0 讨论(0)
  • 2020-11-29 17:56

    I created new UITabBarController in my storyboard and pushed all view controllers to this new UITabBarConttoller. So, all work well in iPhone X simulator.

    0 讨论(0)
  • 2020-11-29 17:57

    I added this to viewWillAppear of my custom UITabBarController, because none of the provided answers worked for me:

    tabBar.invalidateIntrinsicContentSize()
    tabBar.superview?.setNeedsLayout()
    tabBar.superview?.layoutSubviews()
    
    0 讨论(0)
  • 2020-11-29 17:58

    From this tutorial:

    https://github.com/eggswift/ESTabBarController

    and after initialization of tab bar writing this line in appdelegate class

    (self.tabBarController.tabBar as? ESTabBar)?.itemCustomPositioning = .fillIncludeSeparator
    

    Solves my problem of tab bar.

    Hope its solves your problem

    Thanks

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