1
我正在設計一個按鈕,其寬度可以通過不同的內容在程序中改變。我從設計師這樣的PNG文件:Android /造型按鈕:背景也在可繪製的左側和可繪製的右側
[Left Border] [Background (just a strip with the gradient)] [Right Border]
我覺得我很好分配按鈕這樣的性質:
Background: Background.png
Drawable left: LeftBorder.png
Drawable right: RightBorder.png
,但它不應是這樣的;)現在,Background.png開始於可繪製左側開始並在可繪製右側結束時結束。在這種情況下使用這些可繪製屬性不是正確的方法嗎?
這裏是代碼:
<Button
android:text="@+id/Button01"
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/top_loaction_left"
android:drawableRight="@drawable/top_loaction_right"
android:background="@drawable/top_loaction_bg"></Button>
..
謝謝你!你能看看我的更新請願書嗎? – OneWorld 2010-09-16 16:43:17
嗯...我不太確定...讓我探討 – Josnidhin 2010-09-17 02:43:44
我提出了第二個問題:http://stackoverflow.com/questions/3733471/android-9-patch-png-what-if-i-need-水木清華般-A-11-補丁PNG – OneWorld 2010-09-17 07:38:23