How to hide text in UITabBar

霸气de小男生 提交于 2019-12-11 06:27:44

问题


I am trying to create a tab bar with just the image, no title. How would I go about doing this?

Here is how I set the image:

FeedViewController.tabBarItem.image=[UIImage imageNamed:@"Describe-Home_Icon_NormalArtboard-1"];

回答1:


[FeedViewController.tabBarItem setTitle:@""];



回答2:


This can easily be done within the interface builder (storyboard or xibs).

Please see the attached screenshot. You can place name of your image here and simply leave the 'Default title' space blank, as I have done here.

In this way it also cuts down the need for adding unnecessary code to your project, easier to read and edit.

Hope this helps, cheers Jim.



来源:https://stackoverflow.com/questions/21394689/how-to-hide-text-in-uitabbar

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