UITabBar functionality without UITabBarController

前端 未结 3 897
一个人的身影
一个人的身影 2020-12-20 07:08

I have this problem, I\'ve got a navigation-based application, and on the one of the detail view i need to have UITabBar, which will display some UITableViews. Since apple d

相关标签:
3条回答
  • 2020-12-20 07:45

    Now that you are not using a TabBarController for showing the tableviews (as mentioned in the link), have you made sure that the table views or any other views you are adding when a tab is tapped are correct size?

    You are adding a subview or bringing it to top so the table view is probably covering your tab bar.

    0 讨论(0)
  • 2020-12-20 07:47

    don't use a tab bar controller, just use a UITabBar inside your controller view and manage the switches between UITableViews yourself, either by:

    • loading up as many table views as you need and stacking them (bringing the one corresponding to the tab bar hit to front)
    • switching a single table view's data source and delegate among a few helper objects - one per tab in your bar. When the user clicks a tab, reset the single table view's data source then instruct it to reloadData
    0 讨论(0)
  • 2020-12-20 07:51

    When they are choosing an item from your table view are you pushing a new view controller onto your navigation controller? If so, you will leave the tab bar behind!

    Without some hefty hacking, you generally can't do what you're trying to do. What you'd have to do instead is to deal with adding new views yourself when a table cell is selected so the new views you add don't overlap the tab bar at the bottom. Though this will probably break the navigation controller.

    Though my advice is to rethink that part of the app's ui so you don't care that the tab bar vanishes. Sorry :(

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