How to Create a Custom tabBarController to simulate uiTabBarController

情到浓时终转凉″ 提交于 2019-12-06 16:16:17

问题


How to create an custom tabbar controller which has custom background image, custom icons, and custom labels and positioning but serves exactly the same purpose as UITabBarController. I badly seeking for an optimal solution for this.

When i learn the solution this will really help me to write a generic wrapper and save more time.

I have tried having UIViews and making it as footer and banner seperately, but it all consumes lots of memory. I want a simplistic approach which will make the development very optimal.

Please help me friends.


回答1:


  • Create a view (in IB or in code) that will contain 2 subviews - one for tabs and one for content
  • Create view controller that will have references to both views
  • Design the tabs view as you want (BTW it may also be on top of the content view)
  • Drop few designed buttons on the tabs view
  • Each button will remove all the content view's subviews and add some view controller's view as a content view's only subview


来源:https://stackoverflow.com/questions/2136346/how-to-create-a-custom-tabbarcontroller-to-simulate-uitabbarcontroller

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