gpt4 book ai didi

android - 每当我滚动时,ListView 都会重新绘制背景颜色

转载 作者:太空宇宙 更新时间:2023-11-03 11:41:29 29 4
gpt4 key购买 nike

我已经定义了一个自定义主题,我在我的窗口背景上绘制了一个深色渐变。我的 ListView 背景设置为透明,但是每当我滚动时,背景颜色变为黑色,然后在滚动停止后,又回到渐变颜色。这是为什么?

<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme is the default theme. -->
<style name="Theme" parent="android:Theme">
</style>

<!-- Variation on our application theme that has a translucent
background. -->
<style name="Theme.DarkGradient">
<item name="android:windowBackground">@drawable/dark_gradient</item>

</style>

</resources>

最佳答案

您的问题在这里得到解答:http://developer.android.com/resources/articles/listview-backgrounds.html您只需设置 cacheColorHint 即可解决您的问题。 :-)

关于android - 每当我滚动时,ListView 都会重新绘制背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3782046/

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