2013-12-09 1 views
-2

버튼을 사용중인 앱을 개발 중입니다. 버튼의 왼쪽에서 이미지를 사용하고 있습니다. 문제는 이미지의 크기가 크고 버튼의 크기가 맞지 않는다는 것입니다. 이미지를 단추에 맞도록 크기를 조정하려면 어떻게합니까? Plz 좀 해줘. Xml은 이와 같습니다.이미지가 버튼에 맞게 표시되는 방법

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginTop="15dp" 
    android:layout_weight="0" 
    android:weightSum="1" 
    android:orientation="horizontal" > 

<Button 
    android:id="@+id/btn1" 
    style="?android:attr/buttonStyleSmall" 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" 
    android:drawableLeft="@drawable/blue" 
    android:gravity="left|center" 
    android:text="Wallpapers"/> 
    </Linearlayout> 

답변

0

시도가 이미지의 다른 버전을 사용하고 올바른 폴더에 넣어하기 :

res/layout/my_layout.xml    // layout for normal screen size ("default") 
res/layout-small/my_layout.xml  // layout for small screen size 
res/layout-large/my_layout.xml  // layout for large screen size 
res/layout-xlarge/my_layout.xml  // layout for extra large screen size 
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation 

res/drawable-mdpi/my_icon.png  // bitmap for medium density 
res/drawable-hdpi/my_icon.png  // bitmap for high density 
res/drawable-xhdpi/my_icon.png  // bitmap for extra high density 

Hovewer이 http://developer.android.com/guide/practices/screens_support.html가 응답을 당신에게

+0

고맙습니다 도움을 줄 수보고 나에게 올바른 방법을 생각 나게 . – HBBR

관련 문제