2011-07-05 52 views
0

我正在創建一個比例UI,事情就是 - 通過不同的UI分辨率,UI組件獲得不同的形狀。我使用的圖像文本按鈕,對於不同的分辨率有不同的尺寸。我可以這樣做嗎,按鈕的寬度/高度,按鈕調整大小的圖像也是成比例的? (目前圖像不會改變其尺寸,只是其中的一部分被隱藏)。如何調整按鈕內的圖像大小?

這裏是XML的SORCE,我使用這類按鈕:

<Button 
    android:id="@+id/today" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:drawableTop="@drawable/today" 
    android:drawablePadding="0sp" 
    android:gravity="center_horizontal|bottom" 
    android:textSize="8sp" 
    android:text="@string/today" 
    android:onClick="getRSSNews" 
    /> 

回答

0

嘗試創建MDPI和LDPI可繪製太(同名),看看如何將這項工作。

+0

只是將圖像文件複製到兩個目錄沒有任何改變,或者我應該也調整圖像? – nenito

+0

是的,調整它們的大小。我不確定他們應該是什麼尺寸。嘗試調整一個圖像的大小,看看是否有幫助。 – zoroz

+0

什麼都沒有發生! – nenito