开发者

I want to set a Image on UINavigationBar without using nib please help me?

please help me to set the im开发者_如何学编程age on UINavigationBar without using nib.


You have to override the - (void)drawRect:(CGRect)rect method with something like this:

UIImage *image  = [UIImage imageNamed: @"filename.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];

Basically this load an image from a file and then draws it with the exact size of the UINavigationBar.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜