The documentation says that the tab bar image is usually 30x30, but I've found that the best size to setup the images is 48x32 pixels. This size still renders and gives you a bit more space.
The image is a PNG with transparency, only the mask is used. The UI renders the mask gray when unselected or blue/chrome when selected.
Standard display
48x32 .PNG, 24-bit with transparency (but use only 1 color). Worst case size ~500 bytes.
30x30 .PNG, 24-bit with transparency (but use only 1 color). Worst case size ~350 bytes.
Retina display
60x60 .PNG, 24-bit with transparency (but use only 1 color). Worst case size ~2000 bytes.
ipad tabbaritme没有title为何还是给title留了位置啊?
As seen below, my image is being cropped, yet there appears to be enough space to render it. As well, the image seems to be at the top.
I have no title set so want no text there. How can I get the button to center and fit the image?
You can't. Either reconsider putting text there (images are almost never entirely self explaining, the are mostly usefull as visual mnemonic). Or you have to implement the tab bar yourself.
retina模式考虑
self.tabBarItem.image = [UIImage imageNamed:@"tabImage.png"];
Note that the simulator is not case-sensitive, but the device is. Make sure case matches EXACTLY. If you've changed the case of the filename at some point, you'll need to clean and rebuild.