我用android studio开发应用程序。当我在一部手机上运行我的应用程序并且我能够看到背景图像但是当我在另一部手机上运行该应用程序时我无法看到背景而我只能看到一个白色背景而不是。我确实尝试将背景更改为另一个图像,我能够看到它,可能是什么问题?
这是activity.xml文件:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.myapp.myapplication.MainActivity"
tools:showIn="@layout/activity_main"
android:background="@drawable/thewallpaper"
>
图片细节:
尺寸:1080X1920
尺寸:1MB
类型:PNG文件
logcast是:
04-02 15:37:13.998 24933-24933/? I/art: Late-enabling -Xcheck:jni
04-02 15:37:13.998 24933-24933/? I/art: VMHOOK: rlim_cur : 0 pid:24933
04-02 15:37:14.208 24933-24933/com.example.yuliaaa.myapplication E/Typeface: SANS_LOC file not found.
04-02 15:37:15.069 24933-24933/com.example.yuliaaa.myapplication D/Atlas: Validating map...
04-02 15:37:15.159 24933-25005/com.example.yuliaaa.myapplication I/Adreno-EGL: : EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.AF.1.1_RB1.05.00.02.006.020 - CR771817 () OpenGL ES Shader Compiler Version: E031.25.03.06 Build Date: 03/04/15 Wed Local Branch: Remote Branch: refs/tags/AU_LINUX_ANDROID_LA.AF.1.1_RB1.05.00.02.006.020 Local Patches: NONE Reconstruct Branch: NOTHING
04-02 15:37:15.370 24933-25005/com.example.yuliaaa.myapplication W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (3240x5760, max=4096x4096)
答案 0 :(得分:1)
只需将您的图片放入合格资源文件夹:drawable-XXXdpi
,就像这样:drawable-hdpi
以防止在高密度屏幕设备中按比例缩放图片。
了解更多信息请查看: http://developer.android.com/guide/practices/screens_support.html