我的摩托罗拉 Defy Plus 设备出现了一个奇怪的问题。
我得到了一个带有 TabHost 的简单布局,其中包含一个 ImageView 作为其中所有选项卡的背景图像。
出于某种奇怪的原因,特别是在 Motorola Defy 上,ImageView 显示为黑色!但在我测试过的所有其他设备上,它运行良好!(三星 Galaxy SII、Galaxy Mini、Nexus 7)
该图像是一个常规的 .jpg 文件,大小为 102KB,大小为 1330X1774。它位于 res\drawable 文件夹中。它的名字是——“blurtest_cropped2.jpg”
.xml 布局文件如下 -
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id ="@+id/main_background_imageview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/blurtest_cropped2"
android:scaleType="centerCrop"
/>
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<!-- Required for TabWidget -->
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
</TabHost>
谢谢!