changing the height of UITabBar in iOS7/8?

前端 未结 8 2083
轮回少年
轮回少年 2020-12-08 05:29

I am trying to change the height of the stock UITabBar to 44px, similar to Tweetbot\'s tab bar height. I\'ve also seen a few other apps do this as well.

8条回答
  •  爱一瞬间的悲伤
    2020-12-08 05:56

    In swift it is even simpler than all solutions suggested above by using an extensions to UITabBar, no subclassing necessary:

    extension UITabBar {
    
        override public func sizeThatFits(size: CGSize) -> CGSize {
            super.sizeThatFits(size)
            var sizeThatFits = super.sizeThatFits(size)
            sizeThatFits.height = 
            return sizeThatFits
        }
    }
    

提交回复
热议问题