這是我第一次在我的android應用上使用九貼片圖像。它很愚蠢。當我在eclipse佈局編輯器上預覽時,它工作。但是,當我在真實設備(HTC Inspire 4G,HTC Explorer ...)上構建應用程序時,情況並非如此。九個修補程序映像無法在我的設備上工作?
<LinearLayout
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@drawable/shadow_border"
android:gravity="center"
android:padding="0dip" >
<TextView
android:id="@+id/itemdetail_textview_price"
style="@style/textview_nomalBold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="$10"
android:textColor="#F00"
android:textSize="32dp" />
<TextView
android:id="@+id/itemdetail_textview_originalPrice"
style="@style/textview_nomalBold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="$20"
android:textSize="32dp" />
</LinearLayout>
有什麼問題嗎?
更新:
我寫的應用程序在Android 2.2及以上。
我的手機使用Android 2.3
你確定圖片名是'yourimgname.9.png? ' –
shadow_border ..是什麼名字? 'shadow_bordder.9.png' ..檢查每個可繪製文件夾中的wheather是否保留相同的文件,並且全部都是正確的..如果只有一個..那麼它的好.. – MKJParekh
圖像的名稱是「shadow_border.9.png」。當它在Eclipse佈局編輯器 –