title: iPhone: Setting navigationItem button's width property
body: <p>I have been trying to get around setting navigationitem button's width property but couldn't find a way to get it done what exactly I am looking for.</p>
  
  <p>Following code works fine setting button size what I want and appear nicely but I don't see actually button, its rather only my image. It should appear like button and it has background image!</p>
  
  <pre><code>UIButton *addCommentButton = [UIButton buttonWithType:UIButtonTypeCustom];
  [addCommentButton setFrame:CGRectMake(0, 0, 25, 25)];
  [addCommentButton addTarget:self action:@selector(addComment) forControlEvents:UIControlEventTouchUpInside];
  [addCommentButton setBackgroundImage:[UIImage imageNamed:@"myImage.png"] forState:UIControlStateNormal];
  self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:addCommentButton];
  </code></pre>
  
  <p>Following code does that, but I can't set button size (25,25)!! </p>
  
  <pre><code>self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"myImage.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(addComment)];
  </code></pre>
  
  <p>I tried setting width explicitly but it does make no difference!</p>
  
  <p>[[self.navigationItem rightBarButtonItem] setWidth] = 25;</p>
  
  <p>Can someone please help me to sort out this issue. Thanks.</p>