开发者

how can i display a image on button which is presented on UINavigationController iphone?

开发者 https://www.devze.com 2022-12-25 14:01 出处:网络
ho开发者_StackOverflow中文版w can i display a image on button which is presented on UINavigationController iphone ?if you mean the back button that is displaying on the Navigation Bar

ho开发者_StackOverflow中文版w can i display a image on button which is presented on UINavigationController iphone ?


if you mean the back button that is displaying on the Navigation Bar you can do

UIBarButtonItem *barBtnItem = [[UIBarButtonItem alloc]initWithTitle:@"title" style:UIBarButtonItemStyleBordered target:nil action:nil];
barBtnItem.image = [UIImage imageNamed:@"image.png"];
self.navigationItem.backBarButtonItem=barBtnItem;
[barBtnItem release];

Put this code in the Previous page's viewDidLoad method or anywhere else before

[self.navigationController pushViewController:viewController animated:YES];

this line

0

精彩评论

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