开发者

Tint all UIBarButtonItems in my App (MFMailComposer, etc)

开发者 https://www.devze.com 2023-01-22 22:59 出处:网络
I created a custom Navbar for my application using a protocoll: @implementation UINavigationBar (CustomImage)

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

精彩评论

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