2016-08-14 59 views
0

我有這個代碼在按鈕上顯示圖像。按鈕中的中心圖像

如何定位圖像,使其不接觸框架/邊框?

此代碼:

<Button 
       android:layout_width="0dp" 
       android:layout_weight="0.45" 
       android:onClick="EXIT" 
       android:layout_height="95dp" 
       android:text="Exit" 
       android:textSize="22sp" 
       android:layout_marginBottom="10dp" 
       android:layout_marginLeft="10dp" 
       android:background="@drawable/buttonnew" 
       android:textStyle="bold" 
       android:drawableTop="@drawable/zexit" 
       android:textColor="#000000" 
       android:layout_gravity="bottom" 
       /> 

enter image description here

+1

你的問題不太清楚[對我] ... – Shaishav

+0

@Shaishav我已經編輯了什麼似乎有意義 –

+0

需要將一個littele箭頭圖像向下移動到EXIT文本 –

回答

1

既然你指的是按鈕,而不是被拉伸,這將是最好用的填充,而不是保證金,如android:paddingTop