2

As It was suggested in one of my questions I have to use 9-patch image with gradient for listview item background.

But when I use 9-patch image, there are still problems with gradients:

enter image description here

9-patch, test.9.png:

enter image description here

But when I left transperent line 1 px height between gradient and bottom 9-patch line, that responds for horizontal content placement it's all ok, and I have good looking gradients.

9-patch image:

enter image description here

And closer to see transperent line:

enter image description here

And it's a result:

enter image description here

I've got good looking gradients, but there are transparent lines, that I don't need. On the image you can see black background behind list because of this line. How to draw 9-patch image in order to have good gradients and don't have "holes" in background?

I'm using actionbarsherlock for fragments.

Community
  • 1
  • 1
nicolausYes
  • 633
  • 8
  • 33

1 Answers1

1

the Draw9patch images doesn't work well with gradients you will find some diferences displaying it in several Android OS so don´t use it.

Use a GradientDrawable

Changing gradient background colors on Android at runtime

Creating Nine (9) Patch png files with Gradients

Community
  • 1
  • 1
Jorgesys
  • 124,308
  • 23
  • 334
  • 268