Icons have poor clarity in Xamarin forms IOS project - ios

I am using 24x24 pixels icons in my xamarin forms ios project, but not getting good clarity. So I modified all the icons with 32x32 pixel size. Icons sizes are increased but still getting poor clarity.
So which resolution icons are good for xamarin forms IOS project?

For me it has proven to be good practise to add an image in three versions.
A "small" version, being used on non-retina devices, though that is kind of legacy support by now, a "medium" version for usual retina displays and a "large" one for higher ones.
If you name your files properly, xamarin.iOS will automatically choose the right file for the current device.
For instance, I have a file "fa_home.png" with a resolution of 25x25px, "fa_home#2x.png" in 50x50 and "fa_home#3x.png" in 75x75.
Just add the files to your project and reference the first one without the #2x or #3x addition in the name.
For Android , I am using the following sizes:
drawable - 72x72
drawable-hdpi - 72x72
drawable-xhdpi - 96x96
drawable-xxhdpi - 144x144

Related

iOS App Thinning - How to implement it depending on screen size?

Per default Apple only seems to allow #3x, #2x and #1x as suffixes for images and app thinning.
#3x resources seem to be reserved for iPhone 6/7 Plus, even though their screen resolution is smaller than the resolution of the largest iPad Pro - which seems to use #2x.
Is there any way to specifically have 5 different folders with data and use one folder per actual device resolution that is out there? Those folders would be for example (and any new or in-between resolution would use the closest folder and scale):
568p
1136p
1334p
2048p
2732p
Is that possible somehow?
In the Assets in your Xcode project you can click on the + and add a new image set. There you can right click and add iPhone and iPad individually.

Adding #2x and #3x pictures without 1x version

I've started developing an iOS app, adding pictures in resolution which is ok for standard retina screens. Now I want to add #3x pictures for iphone 6 plus and 7 plus. I don't want to include 1x version for older devices. I've renamed all image files to name#2x but these are not recognized in the project anymore. I was thinking that #2x name modifier will be ignored, but this is not the case. Do I need to explicitely add "#2x" in all places I'm referencing these pictures in the code? Or should I leave standard retina versions without any name change and these will be used anyway as #2x and only use #3x name modifier for higher resolution versions?
Use asset catalogs. See Apple Documentation
Then it's really easy to define 1x, 2x and 3x images by drag&drop. If you load the image in code by name (without scale) it works like a charm. If 1x is missing the next possible image will be used automatically.
You can import pdf-images or well known as vector-images as single vector in assets.Hence No need of 1x,2x,3x seperatly.
You can use Blade
Better asset workflow for iOS developers. Generate Xcode image catalogs for iOS / OSX app icons, universal images, and more.
with a definition file like this will generate all the images for you and put it in the right place
blades:
- source: store/slice1.png # this image should be the only image, and the biggest image you can use (typically for icons, 1024x1024)
mount: Project/Assets.xcassets/AppIcon.appiconset

Assets.xcassets - Universal not working

I am using Universal for Assets.xcassets in the hopes that I only have to create 3 different sizes for each image I use. But, despite Assets.xcassets telling me that my images are Universal in the Attributes Inspector, when I test on my iPad, the images are blurry and aren't as sharp as they are on my iPhone, making me question why there is a Universal option.
I've double checked all my images and they are all correctly sized.
My questions:
In the Attributes Inspector, under Universal, there are iPhone and iPad options. In order for my iPad to provide crystal clear images, should I use the iPad option?
And if I should: What's the point of the Universal option if it doesn't really do its job?
Also if I should: What size images do I use. The iPad option gives me the options of 1x and 2x size images. So, should the size of the 1x image for iPad be the same size as 1x image for Universal?
Thanks in advance.
Universal merely means that this app will run on iPad and iPhone natively. Thus the devices on which your app might run can have a single-resolution, double-resolution, or triple-resolution screen.
If you have checked Universal, accordingly, you should see three slots:
Your job, therefore, is to make three versions of your image, sized in proportion. If the 1x is 100x100, the 2x should be 200x200 and the 3x should be 300x300. The version in the appropriate slot will be used at runtime in accordance with the screen resolution of the device we're running on.
The asset catalog does not do any image sizing for you. You have to do it beforehand. (I find Graphic Converter a nice utility for this purpose.)
You could just supply a 3x image and allow the runtime to size down for you, but this is a waste of memory; Apple specifically advises against this in one of the WWDC 2016 videos. So just bite the bullet and make all three image sizes yourself.
Finally:
when I test on my iPad, the images are blurry and aren't as sharp as they are on my iPhone
Hmm, the only reason I can think of for this is that your app is not running natively on the iPad, but is an iPhone app running in "emulation mode" on the iPad. If that's the case, nothing you can do is going to make it look really good. It would be better to write your app as a true Universal app. That is a setting that you make when you create the project initially (though it can be changed later by editing the app target).

Xcode 5.02 Photoshop icon creation

I am currently trying to push an app to the store (Build > Archive), but it keeps complaining about sizes of icons and certain sizes not actually existing.
I cannot find a slot in the Images.xcassets > App icon for a 120 or a 152, so first where do I put these icons so that it builds correctly.
Secondly, this is ridiculous, is there a photoshop script I can use that does the same icon up in 120, 152, and whatever other sizes it needs.
App script for photoshop
http://www.appsbynight.com/2012/09/17/create-every-ios-icon-for-your-app-with-a-photoshop-script/
Not used it, as I have a program on the Mac that converts it for me from a large image to smaller ones.. see below and is free...
https://itunes.apple.com/us/app/prepo/id476533227?mt=12
also the images to have #2x for the larger ons
so
icon-60.png
icon-60#2x.png (120 sized one)
This is not ridiculous.
2*60 = 120
2*76 = 152
Note that's said in "points" and not pixels. You have to check for the coefficient (x2 for Retina Display). Plus, since in iOS7 sizes changed, all iPhone/iPod Touch which can have iOS7 are Retina (that's why there is only the "x2" for iOS7 iPhone). For iPad, there is iPad Mini (non-retina).
I have modified an old photoshop script to create icons that have a size that matches the requirements in xcode 5.2
https://gist.github.com/derpest/8437300
Adding the correct icon to the correct place stops the errors upon validating to push to store.
A good explanation of this is explained here: 'Missing recommended icon file - The bundle does not contain an app icon for iPhone / iPod Touch of exactly '120x120' pixels, in .png format'
If you want an automated way to make your icons at all the right sizes, check out the App Icon Template. It’s a Photoshop file and a companion action that let you design your icon once, then export it all at once. Be warned that you may want to tweak your icons at each individual size to get the best look, but this is a good starting point because it lets you quickly preview your icon at all sizes.

iPad image sizes

I am creating an application for iPad, the images I have available from graphic designer are
really big, almost twice the size.
According to the graphic designer, the images were created keeping in mind iPad 3.
So if I reduce my image size to half and use them, is it going to make any difference on iPad3?
Or there is no difference and it will be compatible in both.
I am new to iOS development and not sure about the image resizing in detail.
Thanks in advance.
You will have two versions of every image where one is double the size of the other and the operating system will decide which version to use. You just need to name the images correctly.
Images for ipad3 will have #2x within the name. Example
image.png <--- non retina ipad
image#2x.png <------ retina ipad (ipad3)
Here is a post explaining this more: Preparing your iPhone App for Higher Resolutions

Resources