2012-02-23 119 views

回答

1

戴维说,你可以更改任何UIBarButtonItem色调的颜色。如果您在IB中添加按钮,则必须在Inspector中使用属性。在栏按钮项目您可以决定样式和色调颜色。

另外,在这里我正在以编程方式向工具栏添加一个棕色的播放按钮。

UIBarButtonItem *play =[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemPlay 
                    target:self 
                    action:@selector(playSomething)]; // if you want to do something when play pressed 
[play setStyle:UIBarButtonItemStylePlain]; // Other options are UIBarButtonItemStyleDone or UIBarButtonItemStyleBordered 
[play setTintColor:[UIColor brownColor]]; // or whatever color u like 


NSArray *items = [[NSArray alloc] initWithObjects:play /*Other buttons like UIBarButtonSystemItemFlexibleSpace can go here*/, nil]; 

[self setToolbarItems:items]; 

请记住,你可以为你想要颜色,按钮等我作为应该UIBarButtonItem个人要宁愿用小图标,图像创意。

希望它有帮助..