Hiding a UINavigationController's UIToolbar during viewWillDisappear:

后端 未结 11 1719

I\'ve got an iPhone application with a UITableView menu. When a row in the table is selected, the appropriate view controller is pushed onto the application\'s

11条回答
  •  走了就别回头了
    2021-02-03 21:36

    I use a custom background image for the toolbar background, and a custom image for the table background. I was having the same issue with the black bar at the bottom as the view transitioned back and forth from another table view. However I set the

    self.navigationController.toolbar.barStyle = UIBarStyleBlackTranslucent;
    

    in viewDidLoad.

    This sets the background image to the full potential size of the background, which if you had a transparent toolbar would make sense. It's probably not a good workaround when you're using the standard opaque toolbar, but for those of you customizing the toolbar anyway, you can get the best of both worlds.

提交回复
热议问题