Positioning UITabBar at the top

前端 未结 9 1780
小鲜肉
小鲜肉 2020-11-28 10:30

I\'m a beginner in iOS development. My question is: is it possible to position UITabBar at the top and how? I can\'t position my UITabBar at the top of the view.

9条回答
  •  伪装坚强ぢ
    2020-11-28 10:57

    After Update to xCode 11.5. Added this code in my controller. work ios 13

    override func viewWillLayoutSubviews() {
            renderTabPosition()
            super.viewWillLayoutSubviews()
        }
    private func renderTabPosition() {
            tabBar.frame = CGRect(x: 0, y: 0, width: tabBar.frame.size.width, height: tabBar.frame.size.height + 5)        
    }
    

提交回复
热议问题