android - How do I use a 9-patch? -


i have 9-patch image , want use "seperate" admob ad app. want draw light blue line ad is.

this 9-patch:

enter image description here

i added layout imageview , xml code:

<imageview     android:id="@+id/imageview1"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_above="@+id/adview"     android:layout_alignparentleft="true"     android:layout_alignparentright="true"     android:src="@drawable/ab_transparent_example" /> 

and result:

enter image description here

but want 9-patch take size of screen, make full blue line left right of screen. i've never worked 9-patch before, doing wrong?

the diagram below pretty visual explanation of 9-patch is. specific problem, should set 9-patch background image.

<imageview     android:id="@+id/imageview1"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_above="@+id/adview"     android:layout_alignparentleft="true"     android:layout_alignparentright="true"     android:background="@drawable/ab_transparent_example" /> 

9-patch diagram


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -