2013-12-16 3 views
0

,이 이미지 버튼을 틀 것으로 보인다 또는 다음 그림을보고, 주변 경계가없는 :ImageButtons에 프레임을 만드는 방법은 무엇입니까? 나는 두 개의 이미지 버튼을 포함하는 안드로이드 응용 프로그램을 개발하고 있어요

enter image description here

대신, 내가 원하는 버튼들이 다음 그림과 같이, 자신의 가장자리에 경계가있는 경우처럼 보이게합니다 :

enter image description here

하고 내 XML 코드입니다 :

<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="fill_parent" 
    android:layout_gravity="center" 
    android:layout_weight="1" 
    android:orientation="horizontal" > 

    <ImageButton 
     android:contentDescription="@string/minus" 
     android:id="@+id/mines" 
     android:layout_width="wrap_content" 
     android:layout_height="fill_parent" 
     android:layout_gravity="center" 
     android:layout_weight="1" 
     android:adjustViewBounds="true" 
     android:padding="10dp" 
     android:background="#21417D" 
     android:scaleType="centerInside" 
     android:src="@drawable/ac_button_minus" /> 

    <ImageButton 
     android:contentDescription="@string/plus" 
     android:id="@+id/plus" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:layout_weight="1" 
     android:adjustViewBounds="true" 
     android:layout_marginRight="15dp" 
     android:padding="10dp" 
     android:background="#21417D" 
     android:scaleType="centerInside" 
     android:src="@drawable/ac_button_plus" /> 

</LinearLayout> 

답변

0

xml에 android:layout_margin이라는 속성을 사용하면 버튼 간격을 원하는대로 지정할 수 있습니다. 예를 들어 개별 면도 지정할 수 있습니다.

<ImageButton 
... 
android:layout_marginLeft="16dp" 
... 
android:scaleType="centerInside" 
android:src="@drawable/ac_button_minus" /> 
+0

나는 분리 될 버튼을 의미하지는 않았지만, – MRefaat

관련 문제