Anton
Anton

Reputation: 1983

android: 9 patch image with transparent borders as a part of the image

9-patch images should have transparent border where 9-patch markup is made: http://developer.android.com/guide/developing/tools/draw9patch.html

But i have 9-patch image with 4 pixels more as a part of the image. I've marked them as not sizeable parts, but they are totally ignored and only not transparent pixels are displayed.

How can i mark transparent image pixels as an image part?

Upvotes: 3

Views: 2056

Answers (2)

B Roh
B Roh

Reputation: 89

Hi,

Try like this:

<ImageButton
    android:id="@+id/imgButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/refresh_icon"
    android:background="@drawable/background_image">

Resources:

refresh_icon

background_image

Upvotes: 1

lulumeya
lulumeya

Reputation: 1628

Are you using draw9patch in android sdk? I'm using draw9patch, when I make an image with photoshop including transparent pixels with amount of which I want, then the image opend with draw9patch, I can see the position of 9patch pixel is edge of the image which is outer position with transparent pixels.

Upvotes: 0

Related Questions