使用石英自定义 UIBarButtonItem [英] Custom UIBarButtonItem with quartz

查看:34
本文介绍了使用石英自定义 UIBarButtonItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何用石英绘制一个与 UIBarButtonItem 样式完全相同的按钮.按钮应该能够显示不同的颜色.我下载了 Three20 项目,但是这个项目真的很复杂,你需要很多时间来忽略整个框架.我只想画一个自定义的 UIBarButtonItem.

How can I draw a button with quartz that has exactly the same style as a UIBarButtonItem. The button should be able to show different colors. I downloaded the Three20 project, but this project is really complex, you'd need a lot of time to overlook the whole framework. I just want to draw a custom UIBarButtonItem.

感谢您的帮助.

推荐答案

如果您使用 Three20 库,我猜 TTButton 的工具栏按钮"样式就是您想要的.TTButton 是 UIButton 的子类,但它允许您在创建网页时像使用 css 一样应用样式.

If you are using the Three20 library, I guess TTButton's "toolbarButton" style is what you want. TTButton is a sub-class of UIButton, but it allows you to apply styles just like using css while creating a webpage.

要创建像 UIBarButtonItem 这样的按钮,只需调用

To create a button like a UIBarButtonItem, just call

[TTButton buttonWithStyle:@"toolbarButton:" title:@"Title"]

您可能需要保留它,因为按钮是一个自动释放对象.

You may need to retain it since the button is an auto-release object.

这篇关于使用石英自定义 UIBarButtonItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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