UITabBar selectionIndicatorImage height on iPhone X

后端 未结 2 582
广开言路
广开言路 2020-12-31 10:53

I\'m using a selectionIndicatorImage for a UITabBar, which is 49 points high, like this: UITabBar.appearance().selectionIndicatorImage = UIIm

相关标签:
2条回答
  • 2020-12-31 11:54

    I had the same issue. I "fixed" it by subtracting the height by 1 pixel, so 48 pixels for the height of the selection image. It seems to be an iPhone X bug.

    0 讨论(0)
  • 2020-12-31 11:59

    Adding 1 point to the top or bottom of your tabBar's selectionIndicatorImage Insets seems to "fix" this for now.

    tabBar.selectionIndicatorImage?.resizableImage(withCapInsets: UIEdgeInsets.init(top: 1, left: 0, bottom: 0, right: 0))

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