我從我的應用程序創建了一個背景圖像,並將圖像的副本添加到每個可繪製文件夾(低,中,高分辨率),然後在main.xml如下Android背景圖像出現在Eclipse但不是仿真器
<?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" >
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.57"
android:background="@drawable/scrollviewtexture">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="90dp"
android:text="Memorable"
android:textAppearance="?android:attr/textAppearanceMedium" android:typeface="sans"/>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_centerHorizontal="true"
android:text="(Swipe To Generate Password)"
android:textAppearance="?android:attr/textAppearanceSmall" android:textSize="5pt"/>
</RelativeLayout>
</LinearLayout>
在Eclipse中它顯示的背景圖像沒有問題,但是當我在模擬器中運行時不顯示。哪裏出問題了?
你使用PNG圖像嗎? – sandalone 2012-04-28 07:05:27
clean ur項目並嘗試再次運行 – Khan 2012-04-28 07:05:36
圖像實際存儲在哪個目錄下:'drawable'或一些'drawable-ldpi','drawable-hdpi','drawable-mdpi','drawable- xhdpi'? – 2012-04-28 07:13:03