Change tabBar height in Swift 5 for IOS 13

限于喜欢 提交于 2019-12-11 06:24:29

问题


I need to change the UITabBar height to 95. I can do that in the older version of iOS Swift. This is my code that work in the older version.

override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews()

    tabBar.frame.size.height = 95
    tabBar.frame.origin.y = view.frame.height - 95

    menuButton.frame.origin.y = self.view.bounds.height - tabBar.frame.size.height - 10
    shadowBtn.frame.origin.y = self.view.bounds.height - tabBar.frame.size.height - 15
}

回答1:


Try it in viewDidLayoutSubviews

override func viewDidLayoutSubviews() {
    super.viewDidLayoutSubviews()
    tabBar.frame.size.height = 95
    tabBar.frame.origin.y = view.frame.height - 95
}


来源:https://stackoverflow.com/questions/58078821/change-tabbar-height-in-swift-5-for-ios-13

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!