简体   繁体   中英

Tab bar icons pixelated and cut off

I am trying to set my UITabbar icons via interface builder. Here is what I am seeing:

在此输入图像描述

Two problems here:

  1. Why is the bottom cut off? The dimensions of these 3 images in order is 64x42, 44x44, 46x46.
  2. Why are they pixelated/blurry?

I am following the guidelines for tab bar icons listed here:
https://developer.apple.com/library/ios/documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html

I am not using the image, image@2x naming scheme. I am just setting these in IB. This app will be only released to devices with retina displays in any case. The screenshot is from an iPhone 5.

The only indication UIKit uses to determine if an image is retina is if it has the @2x scheme. Otherwise, UIKit will treat it as a non-retina image. This is why it is showing the image double the size it should be, because you have not used the naming scheme to tell UIKit that the image should be rendered 4 pixels per screen point.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM