Is there a way to adjust the width of UITabBar button items to fit more than 5 buttons on the screen?

烂漫一生 提交于 2020-01-13 13:06:02

问题


My buttons seem stretched, especially in landscape orientation. I can't find a property to adjust either on the UITabBar, UITabBarViewController, or on the UITabBarItem's themselves. (Of course, one answer would be to get an iPad...but that doesn't solve the need for a phone.)

For example, consider this simple Tab Bar Example - if I only could set the tab bar to auto-shrink as more buttons are added, or manually adjust the width to fit them all on the tab bar, I would be happy.


回答1:


It is not possible to use the UITabbar with more than five visible buttons. You've got to write your own component.

Here at significantpixels.com / The iPhone Tab Bar Lessons From Reality is an article about the tab bar which explains in detail how to design your tab bar from a UX point of view. And the magic number of tabs is five ;)



来源:https://stackoverflow.com/questions/5807695/is-there-a-way-to-adjust-the-width-of-uitabbar-button-items-to-fit-more-than-5-b

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