Sliding UITabBarItems in UITabBarController

前端 未结 4 1848
别跟我提以往
别跟我提以往 2020-12-18 13:36

I have a UITabBarController as my rootController with 8 UITabBarItems. and I want to show just 4 UITabBarItems in my screen. By defaul

相关标签:
4条回答
  • 2020-12-18 13:56

    This is not currently a built-in option for UITabBarContoller.

    One way to approach the problem is to add a UIGestureRecognizer to the tabBar.view, and programmatically adjust which 4 options are available on the screen. You can add an animation to make it smooth or have a little bounce as it slides.

    0 讨论(0)
  • 2020-12-18 14:01

    iPhone users are usually very picky and attached to Apple's UI Guidelines. Although you can pass the Apple verification, you probably wont be able to pass users' (meaning bad reviews and ratings). So I recommend you to re-consider your tabbar structure and use "..." More instead of sliding it... You can always override stuff in code, but then they wont work smooth with InterfaceBuilder and in the end you will have more trouble than you'd expect.

    If you have similar tab items merge them and use maybe a segmented control or something to visually distinguish them. Or use a central navigation screen in which you can put 9 maybe more icons in a grid...

    The first solution to your problem may not always be the best way. Well, it is very rare actually...

    0 讨论(0)
  • 2020-12-18 14:09

    There is a nifty little github project that could help you... check it out: https://github.com/iosdeveloper/InfiniTabBar

    0 讨论(0)
  • 2020-12-18 14:17

    You have to write a custom control for this. I wrote one for showing a horizontal menu. You can probably modify that to fit your needs. http://blog.mugunthkumar.com/coding/ios-control-mkhorizmenu/

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