2015-04-15 58 views
0

我做了很多搜索,我真的很困惑。9補丁不能正常工作我做錯了什麼?

這是我的9補丁文件,結果在我的按鈕的設備和XML。請告訴我什麼是錯的吧

<Button 
    android:id="@+id/btnFlightInfo" 
    android:layout_width="fill_parent" 
    android:layout_height="110dp" 
    android:background="@drawable/btntest1" 
    android:layout_marginTop="10dp" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp" 
    android:paddingRight="10dp" 
    android:paddingTop="5dp" 
    android:gravity="right|center_vertical" 
    android:text="Flights" 
    android:textColor="@color/white" 
    android:textStyle="bold"/> 

nine patch file
enter image description here

result on android device
enter image description here

+1

確保圖像保存爲.9.png –

+1

謝謝你的男人。你是一個救星!什麼錯誤。我的爸爸。 – user2745894

+0

它發生了兄弟。 ;)沒有什麼可以感到羞愧的,發生在我們身上。 –

回答

0

如果file是在你的項目的圖片,你應該保存btntest1.9圖片。 png在android中指定這是一個九個補丁。

+0

謝謝。我知道,但我不知道我錯過了什麼。我會盡快將其標記爲答案。 – user2745894

相關問題