开发者

How to change back button from text to image in UINavigationBar

UIBarButtonItem *backButton = [[UIBarButtonItem alloc]  
                               initWithImage:@"rGoBack" 
                     开发者_如何转开发          style:UIBarButtonItemStylePlain  
                               target:nil action:nil];  
self.navigationItem.backBarButtonItem = backButton;  
[backButton release];

I use this source. but It doesn't work. I don't know why not. please..


From the first glance:

initWithImage:@"rGoBack" 

here UIImage parameter required and NSString is passed instead. Try writing something like:

initWithImage:[UIImage imageNamed:@"rGoBack.png"]; // or whatever image name you have
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜