开发者

Tint all UIBarButtonItems in my App (MFMailComposer, etc)

I created a custom Navbar for my application using a protocoll:

@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect {
    UIImage *image = [UIImage imageNamed: @"navbar.png"];
    [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end

Tint all UIBarButtonItems in my App (MFMailComposer, etc)

this works fine. all toolbars in my application look great now. but i also want a way开发者_Go百科 to tint my uibarbuttonitems in my toolbar. i could set the tint color of every button, but this does not work on pre-defined items like the ones in my mailcomposerview and so on.

is there a way to give all my buttons a tint color? just like i've done that with my navigation bar.


You'll need to set the tintColor for navigationBar property of your navigation controller.


self.tintColor = whatever in your drawRect will do it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜