自定义UITabBarItem图像/标题在iPhone上 [英] Custom UITabBarItem Image/Title on iPhone

查看:172
本文介绍了自定义UITabBarItem图像/标题在iPhone上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向其中一个预定义的UITabBarItem添加自定义标题。每当我选择在Interface Builder中我喜欢的特定实例 - 如果我修改标题它被预设回一个'自定义'标识符。理想情况下,我想使用自己的自定义标题从书签标识符中选择书本图标。



SDK目前支持的自定义级别是什么?



感谢任何洞察力或文档,指出我的方向是正确的。

不幸的是,UITabBarItem的唯一类型是完全由操作系统提供和描述的类型(即,它分配它们的图标和标题),和那些完全由应用程序描述,如你所发现的。到目前为止,最简单的解决方案是将图标从其他地方拉出,并使用 -initWithTitle:image:tag



http:// img369 .imageshack.us / img369 / 8388 / openbookwp4.png


I'd like to add a custom title to one of the predefined UITabBarItems. Whenever I select the particular instance I like in Interface Builder -- if I modify the the title it gets preset back to a 'custom' identifier. Ideally I'd like the book icon from the 'Bookmarks' identifier with my own custom title.

Is this level of customization currently supported by the SDK? Am I going to have to ultimately screen scrape the image and apply it as a custom image?

Thanks for any insight or documentation which points me in the right direction.

解决方案

Unfortunately, the only types of UITabBarItems are those supplied and described entirely by the OS (ie, it assigns them icons and titles), and those described entirely by the app, as you've discovered. By far the simplest solution is to pull the icon out of somewhere else and use it with -initWithTitle:image:tag.

http://img369.imageshack.us/img369/8388/openbookwp4.png

这篇关于自定义UITabBarItem图像/标题在iPhone上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆