title: Objective C: How to maintain image resolution/quality in navigation buttons and tab bars
body: <p>I am trying to put an image to the navigation item's right button via the following code</p>
  
  <pre><code>//Add image to right bar button in navigation bar
  UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"refresh.png"] style:UIBarButtonItemStyleBordered target:self action:@selector(getData)];
  
  self.navigationItem.rightBarButtonItem = rightBarButton;
  [rightBarButton release];
  </code></pre>
  
  <p>The image I has a dimension of 52 X 52 pixels.
  If I just add the image into the button without changing the size, I will get a unproportionate display as seen below</p>
  
  <p><img src="https://i.stack.imgur.com/QqmI7.png" alt="enter image description here"></p>
  
  <p>However, if I try to shrink the image before adding to the button (18 X 18 pixels), the image will look blurry on the iPhone retina display</p>
  
  <p><img src="https://i.stack.imgur.com/w1iSH.png" alt="enter image description here"></p>
  
  <p>This is also happening for the tab bars for the iPhone retina display.</p>
  
  <p><img src="https://i.stack.imgur.com/ARXKr.png" alt="enter image description here"></p>
  
  <p>Is there any way to use a large image in the button or tab without getting a disproportionate display? Or is there a way to maintain the resolution of the image?</p>