问题描述
我创建了一个项目,旨在 Android 4.4系统 - API等级19
,所建议的日食
I have created a project, targeting android 4.4 - API Level 19
, as suggested by eclipse.
不管怎么说,在模拟器上的一切看起来很完美 - 在这里是截图:
Anyways, on the emulator everything looks perfect - here is a screenshot:
该问题来当我我真正的设备上安装 - 运行Android 4.1.2
。一切的一切都完美的,工作就像一个魅力,除背景图像。它显示一个白色的背景,喜欢的图片不存在。
The problems comes when I install it on my real device - running android 4.1.2
. Everything is just perfect and working like a charm, excepting the background image. It is showing a white background, like the picture does not exists.
下面是我的xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity"
android:orientation="vertical"
android:gravity="center"
android:padding="30dp"
android:background="@drawable/wg_blurred_backgrounds_12"
>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btnTopJokes"
android:onClick="showTopJokes"
android:gravity="center"
/>
<Button
android:layout_marginTop="10dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btnNewJokes"
android:onClick="showNewJokes"
android:gravity="center"
/>
<Button
android:layout_marginTop="10dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btnAllJokes"
android:onClick="showAllJokes"
android:gravity="center"
/>
<Button
android:layout_marginTop="10dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btnMyFavorites"
android:onClick="showFavorites"
android:gravity="center"
/>
<Button
android:layout_marginTop="10dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btnCategories"
android:onClick="showCategories"
android:gravity="center"
/>
<Button
android:layout_marginTop="10dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btnAddNewJoke"
android:gravity="center"
/>
</LinearLayout>
不是机器人:背景=@可绘制/ wg_blurred_backgrounds_12
工作在Android 4.1.2
Isn't android:background="@drawable/wg_blurred_backgrounds_12
working on android 4.1.2
?
我必须改变在premissions什么?以下是我现在有:
Do I have to change anything in the premissions? Here is what I have now:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
我知道我错过了什么非常小的,但我没能发现它作为一个初学者。
I know that I miss something really small, but I'm not able to spot it as a beginner.
推荐答案
尝试使用较低分辨率的背景。也许太大了。你可以看到在logcat中。
Try with a lower-resolution background. Maybe too big. You can see that in your logcat.
这篇关于Android设备没有显示背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!