如何自定义 UITabBarItem 上的标题?

发布于 2024-11-13 23:36:03 字数 195 浏览 4 评论 0原文

使用initWithTabBarSystemItem方法创建UITabBar对象时有没有办法设置标题?我后来尝试设置标题属性(在 viewController 和选项卡栏项目上),但似乎没有什么区别。我了解 initWithTitle: image: 方法,但我想使用带有自定义标题的系统图标之一。

When using the method initWithTabBarSystemItem to create a UITabBar object is there a way to set the title? I've tried setting the title property (on the viewController and tab bar item) afterwards but it doesn't seem to make a difference. I know about the initWithTitle: image: method but I want to use one of the system icons with a custom title.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

迷离° 2024-11-20 23:36:03

如果您使用的是系统项目,则无法自定义它,您将必须制作一个自定义项目,并使用相同或相似的艺术品...您可以从以下位置获取艺术品:http://www.teehanlax.com/blog/iphone-gui-psd/

If yo are using the systemItem you can't customize it, you will have to make a custom Item, and use the same or similar artwork... you could get the artwork from: http://www.teehanlax.com/blog/iphone-gui-psd/

浅笑轻吟梦一曲 2024-11-20 23:36:03

您可以通过两种方式做到这一点。

   UITabBarItem *tabBarItem = [[UITabBarItem  alloc ] init ];
   tabBarItem.title = @"Custom title";

转到界面生成器;单击 UITabBarItem 并对其进行编辑。

You can do it in two ways.

   UITabBarItem *tabBarItem = [[UITabBarItem  alloc ] init ];
   tabBarItem.title = @"Custom title";

or

Go to the interface builder ; Click on the UITabBarItem and edit it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文