[iPhone]改变信息暗按钮的颜色

时间:2011-04-06 12:50:28

标签: iphone objective-c cocoa-touch

请我想更改图片中显示的信息Dark按钮的颜色(右上角)可见。 enter image description here

2 个答案:

答案 0 :(得分:5)

有两种方式:

  • 使用Interface Builder:选择按钮,将其类型更改为“Info Light”
  • 以编程方式:yourButton = [UIButton buttonWithType:UIButtonTypeInfoLight];

这是你在找什么?

答案 1 :(得分:1)

使用您引用的下面一段代码,

UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight];
UIBarButtonItem *customItem = [[UIBarButtonItem alloc] initWithCustomView:button];
self.navigationItem.rightBarButtonItem = customItem;
[customItem release];