Set custom width height image drawable in Android button -


this want do: customize image size because it's little big.

i creating android application , in button, have image , text. want customize size of image fit on screen. however, have difficulty manipulating image. if adjust width , height, of button's. wanted adjust image size. possible?

here's code snippet of button:

<button     android:id="@+id/marketbtn"     style="?android:attr/buttonbarbuttonstyle"     android:layout_width="0dp"     android:layout_height="match_parent"     android:layout_gravity="bottom"     android:layout_weight="1"     android:background="@drawable/unselected_button"     android:drawabletop="@drawable/market_icon_0"     android:gravity="center"     android:paddingbottom="5dp"     android:paddingleft="1dp"     android:paddingright="1dp"     android:paddingtop="5dp"     android:text="@string/task_bar_lbl_market"     android:textappearance="?android:attr/textappearancesmall"     android:textcolor="#ffffff"     android:textsize="10sp" /> 

do have idea how it? or possible approaches fulfill task?

use nine-patch.

you can set stretchable area , padding area.

http://developer.android.com/tools/help/draw9patch.html


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -