Tab bar icons on retina display - ios

I am making an iPhone App but I can't understand why my custom tab bar icons are pixelated. They are 30x30. If I change the resolution to 60x60, for example, the icons are still pixelated but they are also incomplete.
Can you help me to fix this problem? Thank you very much.

You don't need to double the size of your non-retina images.
You need to create two separate icons icon.png (30x30) and icon#2x.png (60x60).
iOS will automatically load the right file based on the screen scale.
You can find more information about taking advantage of the retina display at this url: https://developer.apple.com/resources/high-resolution/

Related

I can't create a splash screen for a Flutter app, using Xcode for iOS

I read lots of articles about the Splash Screen and how to create it in Flutter but almost all of them are deprecated now. Neither one worked for me, and I did try by myself, but the Splash Screen is not displaying, instead is displaying a white background.
I found out a package which could make my life easier, but I think it's better to create the Splash Screen as it is created from the official documentation.
As I understood, I opened the Runner.xcworkspace folder in Xcode. After that I uploaded 1x, 2x, 3x images which were the logo with transparent background. (I used the same size)
I didn't find the real sizes for 1x, 2x, 3x images anywhere for 2021/2022. A few people put there full images, while the others put only the logo.
I decided to change the background color from the View property as in the image below and I've fixed the image with the drag option and I am pretty sure that it's not a good approach.
So, even if I created somehow the Splash Screen, it is not rendered on the devices. I restarted the emulator, deleted the app and didn't work for me.
The question is, how to create Splash Screen for iOS in a correct way and why it is still a white background?
Edit: I managed to display the Splash Screen selecting this property in the image above, but as I expected, it is not rendered well. So the question remains: how to create Splash Screen for iOS in a correct way?
Edit 2: The logo is now centered by autoresizing arrows from Size Inspector, but after 1 second it is resizing between 1x, 2x, 3x. Also, I used 3 constraints.
Chose your logo and click here:
image
Use alignment constants and set your logo 0 horizontally and 0 vertically. (Be sure you have chosen your logo file). Click "Add 2 Constants" It will show your logo in a centre at every Apple device.

Launch Screen File with different images

My design team has given me various launch screen images for all types of screen sizes found here.
I want to support iPhone 6+ and iPad Pro so I know launch screen files should be used instead of image assets.
However, how do I specify in my launch screen file the different images for each screen size? I thought size-classes would be the way to go but I can't differentiate between iPad Air 2 and iPad Pro that way.
There's also no iPad Pro image asset either.
You can look at device specific image assets (on the attributes inspector of an image in an asset bundle).
It may be impossible to match the design exactly because you can't run code at this point. It may be easier to explain this to the designers and have them design to the constraint.
One simple idea is to have a centered image at the correct resolution and to use a view underneath to have a background (color or tiled image).

How to force universal app on iPad into scale mode?

I created an universal iOS app. On all iPhone variants I want native resolution without scaling, so I created splash screen images for all available sizes in images.xcassets/LaunchImage.launchimage and set them all in Xcode:
Now, this works very well for all iPhone versions up to the biggest iPhone 6 Plus.
On iPad (with high pixel density) though I don't want native resolution. Instead I want it to scale the app (even if it looks a bit blurry then, but that's ok).
How would I do that?
In image assets you have to provide proper size for each launch screen, You can not use the same image for two devices in launch-images ( unless you have two copies of the same image ).
If you want to make app-size smaller, implement launch screen, set its background color to your desired background color and put your logo in the center of it. You can now remove iPhone 6,6Plus images from image assets, but you still have to provide launch images for iOS 7 devices (old iPhones / iPad ).
Don't use the Asset Catalogue. Create a LaunchScreen.xib , add a UIImage inside the view. Open the attribute inspector in the right hand panel and set the view mode to Aspect Fill.
The solution was quite easy, I simply changed project type from "universal" to "iphone" and that did the trick!

iOS tab bar icons are blurry

My tab bar icons appear blurry.
I created the icons using Photoshop, and followed the iOS Human Interface Guidelines when I decided the sizes of each icons.
e.g. icon size: 30x30px png
This only happens with the tab bar. I wonder if this happens because of the resolution of the images or because of programming issues...
You're using icon size 30x30 which I assume is for 1x (iPhone<4). Since iPhone>=4 needs 2x and 3x images so you have to include that also.
Either you use images with naming conventions like
star.png // 1x = 30x30
star#2x.png // 2x = 60x60
star#3x.png // 3x = 90x90
or you can use image.xcassets and put your 1x, 2x and 3x images there and use it.
Reference Xcode Assets Catalogs
Probably because using a device with the retina screen.
Try about changing the icon's filename to xxx#2x.xxx like "facebook_icon#2x.png".
Also, be aware that you can use a PDF file (vector graphics, resolution independent) instead of PNGs, and Xcode will render the appropriate resolutions at build time for you (I don't think you can easily do this for third party icons such as Facebook, but...).
To see how this is done, create a new project using the "Tabbed Application" template, and check the asset catalog for the tab bar icon images. It does just that for the circle and square icons of the "First" and "Second" initial tabs.
Use this line of code to set image for uitabbaritem in uitabbar .
tabbaritem.image = [[UIImage imageNamed:#“image”] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

iOS Navigation Bar Icon Size iPhone 6

Excuse me if this has been asked but I cannot seem to find a good answer.
I have vector PNG icons that were generated at 64x64 pixels.
What I'm trying figure out is how to add them as custom nav bar button icons so they look good in iOS8/iPhone 6 down to iPhone4s.
It seems like when I add the 64x64 icon in XCode and associate the icon with the custom button it doesn't scale down, it just remains 64x64 which is too big for the nav bar itself.
What is the best way to handle this? I don't want want it to look pixelated in in retina.
You need add to project 2 files for each devices scales with such names:
your_icon_name#2x.png - for iPhone4, 4s, 5, 5s and iPhone6;
your_icon_name#3x.png - for iPhone6 plus.
https://developer.apple.com/library/IOs/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html - The sizes of icons for each scale.
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/LoadingResources/ImageSoundResources/ImageSoundResources.html#//apple_ref/doc/uid/10000051i-CH7-SW17 - This to learn deeper about different resolutions support in iOS.

Resources