gpt4 book ai didi

Android 的渐变绘图 : poor quality of screenshots in Eclipse

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:40:58 25 4
gpt4 key购买 nike

我正在使用像下面这样的具有渐变背景的可绘制对象:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient
android:startColor="#ffffff"
android:endColor="#cccccc"
android:angle="-90"
android:dither="true" />
</shape>

这会导致模拟器出现带状渐变,当我截取模拟器的屏幕截图(使用 Eclipse)时,结果更差:

enter image description here

为什么?以及如何解决这个问题?尽管我在可绘制对象的 XML 中使用了 android:dither="true" 并在 ActivityonCreate() 中进行了设置>:

    getWindow().setFormat(PixelFormat.RGBA_8888);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);

顺便说一句,蓝色部分是 native 操作栏,灰色渐变是带有可绘制背景的 ListView 行。

最佳答案

只是为了确保阅读此问题的每个人都能看到解决方案:

正如 davehale23Chris Stratton 指出的那样,问题不在于 Eclipse 或正在“拍照”的应用程序。问题是 Android 模拟器,它显然使用了减少的位深度。

因此,如果截取应用程序的屏幕截图,则应始终使用真实设备。

关于Android 的渐变绘图 : poor quality of screenshots in Eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13542808/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com