I want to add two button and a image view on navigation bar. I written following code for adding image but it is not working.
UIView *customView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];
UIImageView *logo=[[UIImageView alloc]init];
logo.image=[UIImage imageNamed:@"sdas.jpeg"];
[customView addSubview:logo];
self.navigationController.navigationItem.titleView=customView;
尝试这个
self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Your Image Name"]];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.