我有一个启动画面,其中有一个ImageView
作为背景的一部分。无论我是否允许缩放(我所做的)位图,图像质量都很糟糕。我认为这是减少颜色深度。我已经环顾过了,一个建议是将我的图像放在raw
而不是drawable
,但这也没有帮助。下面是截图:可怕的ImageView位图质量?
究竟这是怎么回事,我该如何解决?
编辑:我没有以编程方式应用此位图,所以没有相关的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);
的建议这让一个明显的区别,但条纹仍然存在。 This是我用作背景的图像。
发布您的代码。 – 2013-04-04 11:30:17
对不起。 – 2013-04-04 11:35:02
图像的大小是多少? – 2013-04-04 11:47:32