Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS - Retina display assets not working?

I'm running my app on an iPhone 4, and the navigation bar and all my labels are very blurry (Non-retina). Most blurry ui elements are iOS default UIs.

When I run other applications on my phone they look a lot nicer, and you can easily see the difference.

Is there any project setting that I need to change in order to get higher quality Assets to be used in my app?

EDIT:

I don't care about my own assets, What I care about right now is the DEFAULT UI ELEMENTS IN IOS

EDIT:

I have added a shadow to my main UINavigationController, In order to improve performance while animating the shadows, i set ShouldRasterize to YES, removing this line of xode fixes the problem

[self.navigationController.view.layer setShouldRasterize:YES];
like image 360
aryaxt Avatar asked May 02 '12 22:05

aryaxt


2 Answers

If you set Should Rasterize you have to remember to set your rasterization scale.

[self.view.layer setShouldRasterize:YES];
[self.view.layer setRasterizationScale:[UIScreen mainScreen].scale];

You have to remember that rasterizing converts the layer to a simple bitmap thats stored in memory to save cpu cycles during complex animations. However if you're on a Retina device you need to make sure you save it at double the scale since the screen has 4 times the pixels.

like image 56
Ryan Poolos Avatar answered Oct 29 '22 19:10

Ryan Poolos


Have you made the doubled sized imaged with the @2x suffix to it?

e.g. navBarBackground.png & [email protected] (last one is double the size of the first one)

http://developer.apple.com/library/ios/DOCUMENTATION/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW16

like image 28
Paul Peelen Avatar answered Oct 29 '22 21:10

Paul Peelen