我已經創建bg3.9.png圖像使用.9.png像下面這個教程背景
http://developer.android.com/guide/developing/tools/draw9patch.html
,但是當我把它放在我的drable文件夾,並嘗試使用它,然後它給錯誤在項目 請看圖片。
main.xml中文件的代碼是:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical" android:background="@drawable/bg3">
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:columnWidth="65dp"
android:numColumns="auto_fit" android:verticalSpacing="10dp"
android:horizontalSpacing="10dp" android:stretchMode="columnWidth"
android:gravity="center" android:layout_gravity="center_vertical|center_horizontal"/>
</LinearLayout>
請指導我對我做了什麼錯?
讓你刪除非png圖片.9.png圖像而得名? –
我也有過。將九個修補程序映像添加到可繪製文件夾會導致Eclipse無法構建您的項目。嘗試刪除文件,做一個乾淨的版本,然後嘗試添加九個補丁。有時,我不得不從頭開始重新創建九個補丁映像。 –
是的,我已經從繪製文件夾中刪除非PNG圖像,但仍同樣的問題:(和現在從頭開始創建new.9.png圖像是工作,但現在我的網格視圖沒有顯示整個屏幕上了,請參閱編輯代碼 – Shruti