android - 渐变兼容性问题 - ICS 默认使用的颜色比所有以前版本的 Android 都少

标签 android android-4.0-ice-cream-sandwich

2.3.3 left, ICS on right (emulator). Notice the gradient fade effect difference inside the red box.

左边是 Gingerbread (2.3.3) 模拟器,右边是 ICS (4.0.3) 模拟器。注意红色框内的渐变淡入淡出效果差异(在单独的窗口中打开以查看全尺寸图像)。

主视图背景:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/app_bg"
android:orientation="vertical" >

...

</LinearLayout>

app_bg.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#000" android:centerColor="#333"
    android:endColor="#000" android:angle="270" />
</shape>

是什么导致了这个问题?如何解决这个问题,使 ICS 渐变看起来像 2.3.3 版本一样平滑?问题是否只出现在模拟器上?

最佳答案

我认为问题在于 android(在右侧)使用较少的颜色绘制渐变。我相信您希望启用抖动以帮助掩饰颜色深度的下降。也许看到这个答案link

我不完全确定它是如何工作的,但我相信 android 有时会默认为 RGB_565 模式,即使设备支持 24 位颜色。

关于android - 渐变兼容性问题 - ICS 默认使用的颜色比所有以前版本的 Android 都少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8636388/

相关文章:

java - PutParcelable 无法应用于 Place.Type 错误?

android - 使 Honeycomb ActionBar 与 ICS 兼容

android - 如何在 ICS 手机上禁用/隐藏三点指示器(选项菜单指示器)

android - 自更新到 Ice Cream Sandwich 后,MediaMetadataRetriever 几乎停止工作

android - Android studio 3 中找不到 HPROF Analyzer 工具

Android 按钮栏切换

android - ubuntu终端中的错误命令

android - 如何在 ListView 中设置 json 解析数据,然后在其中添加搜索功能

android - 解析具有相同名称标签的 XML 在 Android 中给出 null

android - 带按钮的 ListView