开发者

UIToolbar custom background image

开发者 https://www.devze.com 2023-04-07 11:28 出处:网络
in loadView method I set self.navigationController.toolbarHidden = NO; That will display a toolbar at the bottom of every view.

in loadView method I set

self.navigationController.toolbarHidden = NO;

That will display a toolbar at the bottom of every view. Now I want to have a custom background for every toolbar. So in app delegate I have following code:

@implementation UIT开发者_StackOverflowoolbar(CustomImage) 
    -(void)drawRect:(CGRect)rect{ 
        UIImage *image = [UIImage imageNamed:@"toolbar.png"];
        [image drawInRect:self.bounds]; 
}
@end

but this has no effect. The color has still this standard blue color. How can I have a custom background?

0

精彩评论

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