【发布时间】:2012-10-30 11:10:23
【问题描述】:
我想在 android 上显示 png 图像。这是图片文件:
右端比左端暗一点。
但是在android应用程序上图像质量丢失(使用ImageView):
请注意红框内的部分。颜色变化不是很顺畅。
但是如果我使用我的安卓手机的浏览器,它可以很好地播放(所以不是手机屏幕的原因):
这是我的安卓代码,非常简单:
<?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:layout_height="fill_parent">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/hhh"/>
</LinearLayout>
hhh 是我在此处发布的第一张图片,位于res/drawable 下。
我在我的安卓手机(安卓2.3.6)和安卓模拟器(安卓2.2/2.3/4.0)上测试,都显示不好。但它在我的 android pad(android 4.0.3) 上玩得很好。
有什么问题,如何解决?
【问题讨论】:
-
尝试从您的图像编辑器中保存带有 Alpha 通道的 png(像素不是完全不透明)。
-
你试过用代码设置ImageView吗?使用代码您可以启用更多选项有一个类似的问题,其答案可能对您有所帮助。 stackoverflow.com/questions/7312996/…