LouieGeetoo
LouieGeetoo

Reputation: 868

Why are my project's drawables blurry?

For some reason, the drawables in my app are blurry. This is especially apparent in menus when I put built-in system icons side-by-side with icons from my project's res folder.

blurry project icon next to crisp system icon

Here's an example. The left envelope icon is in my app's drawable-hdpi folder. It is scaled down, for some reason. The right one is using the built-in Android resources. As far as I can tell, they are the same 72x72px file--I copied the png straight from the drawable-hdpi folder in SDK to my project's drawable-hdpi folder.

Is there some special setting for drawables in my app that I'm missing?

Upvotes: 2

Views: 2126

Answers (2)

Yoni Samlan
Yoni Samlan

Reputation: 38065

Try adding the appropriate supports-screens element to your Android manifest, and make sure you have a min-sdk of at least 4. Also make sure your uses-sdk element is nested under the manifest and not under the application (if it's in the wrong place or missing, your app will still work but can cause issues with compatibility-related code like resource scaling, and will prevent uploading to the market with an obscure error... it can be a tough one to track down).

Upvotes: 4

Matthew
Matthew

Reputation: 44919

Are you using an mdpi screen? If so then your device is having to take the drawables from drawables-hdpi and scale them down, which would likely cause them to blur.

You might try also copying the -mdpi resources to your drawable-mdpi folder, which would allow the framework use your drawables without adjusting for screen density.

Edit - now that I think about it, I'm not sure why your image would appear smaller unless your screen had a greater dpi than hdpi.

Upvotes: 0

Related Questions