2012-02-23 38 views
2

我有一個9-patch按鈕,右邊有一個可繪製的按鈕,並且文本分配給按鈕,當我使用正常圖像時顯示文本,當我使用顏色時顯示文本,但是當我使用9補丁圖像時,它不顯示圖像。9-Patch按鈕不顯示文字

以下是代碼+圖片;

<Button 
     android:id="@+id/btn_active_timer" 
     android:layout_width="300.00dp" 
     android:layout_height="38.00dp" 
     android:layout_marginLeft="10.00dp" 
     android:layout_above="@+id/gui_menu_container" 
     android:layout_marginBottom="6.00dp" 
     android:background="@drawable/ui_black" 

     android:drawableRight="@drawable/ui_arrow_small" 
     android:text="Whats the time mr woolf?" 
     android:textColor="#FFFFFF" 
     android:textSize="15.00dp" 
     android:gravity="left|center_vertical" 
    /> 

enter image description here

回答

6

看看你的9補丁填補區域 - 他們是在大小1px的 - 不可能有這個1個像素的任何文字。 我的猜測是,你對填充和拉伸區域感到困惑。嘗試用底部/右側替換頂部/左側。

+0

哇,9貼片中的一個簡單的教程是爲了,非常感謝你! – Xavier 2012-02-23 19:11:08