0

in my android app I want to achieve this kind of effect

enter image description here

Thinking about different resolutions and densities I decided to create a nine-patch png file:

enter image description here

When I stretch it it looks quite fine:

enter image description here

But in the android simulator it is blurred

enter image description here

As you can see the quality is bad. Why? What do I have to do to achieve the quality from the first image?

1
  • Did you create one nine patch image per screen density (ldpi, mdpi, hdpi)? It is necessary for your image to look fine on every device. Commented Dec 20, 2011 at 15:29

1 Answer 1

4

First of all you should provide different 9-patches for ldpi, mdpi, hdpi screens. Then write in manifest file this tag:

<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" /> 

Then android will take appropriate drawable and will not blur it.

Sign up to request clarification or add additional context in comments.

1 Comment

I just created a tool that resizes nice patch nicely. Just drag n drop a .9.png file and it will create ldpi, mdpi, hdpi 9p from the xhdpi version : code.google.com/p/9patch-resizer

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.