我有一个大小相当于Nexus-5维(1080×1920像素)的飞溅屏幕的图像。现在,当我在LinearLayout的背景中添加这个图像时,它似乎被压缩了,下面是代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:background="@drawable/app_bg"
android:layout_height="fill_parent">
<!--
<ImageView android:id="@+id/splash_screen"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/app_bg"
android:layout_gravity="center"/>
-->
</LinearLayout>真实形象是

附件是附件5的屏幕截图。

发布于 2015-12-03 18:27:42
为了将图像设置为背景,您应该使用下面的图像视图,并为此使用android:scaleType="centerCrop"和框架布局。
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop">
</ImageView>
谢谢
https://stackoverflow.com/questions/34073064
复制相似问题