0

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;
user1672134
  • 35
  • 1
  • 8

2 Answers2

0

Try This

self.navigationItem.titleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Your Image Name"]];
nick28
  • 134
  • 2
  • 7
0

Try using initWithCustomView to add buttons as describe here, and setBackgroundImage:forMetrics using this way.

Community
  • 1
  • 1
NeverHopeless
  • 11,077
  • 4
  • 35
  • 56