我有一个启动画面,其中
编辑:我没有通过程序应用此位图,因此没有相关的Java代码。这里是此活动的XML代码:
ImageView
扮演背景的角色。无论我是否允许我的位图缩放(我这样做了),图像质量都很差。我认为它正在降低颜色深度。我已经在SO上查找过了,一个建议是将我的图像放置在raw
而不是drawable
中,但也没有帮助。这里是屏幕截图:
到底发生了什么,我该如何解决呢?编辑:我没有通过程序应用此位图,因此没有相关的Java代码。这里是此活动的XML代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/RelativeLayoutSplash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawingCacheQuality="high"
android:orientation="vertical"
android:padding="@dimen/splash_padding"
android:scrollbarAlwaysDrawVerticalTrack="true"
tools:context=".SplashActivity" >
<ImageView
android:id="@+id/ImageViewBg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/logo_description"
android:scaleType="centerCrop"
android:src="@drawable/splash_bg_register" />
<ImageView
android:id="@+id/ImageViewLogo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/logo_description"
android:maxHeight="@dimen/logo_maxheight"
android:maxWidth="@dimen/logo_maxwidth"
android:layout_centerVertical="true"
android:src="@drawable/logo" />
<TextView
android:id="@+id/TextViewCopyright"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="@string/copyright"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/white_50"
android:textSize="@dimen/copyright_size" />
</RelativeLayout>
编辑: 我已经尝试了建议中的getWindow().setFormat(PixelFormat.RGBA_8888);
,这使差异可见但是色带依然存在。这个是我用作背景的图片。