设置机器人:windowBackground到@null使滚动涂抹? [英] Setting android:windowBackground to @null makes scrolling to smear?
问题描述
我使用的是大侦探动作条库,以支持多种设备。我有一个 viewPager
其中有3个片段:
i'm using the sherlock actionbar library in order to support many devices . i have a viewPager
which has 3 fragments :
- 在一个具有
的ListView
,每个项目都有一个的TextView
和ImageView的
- 第二个有一个
的GridView
,每个项目都有一个的TextView
和ImageView的
- 第三只是有一个
的TextView
现在。
- one with a
listView
, each item has atextView
and animageView
- the second has a
gridView
, each item has atextView
and animageView
- the third just has a
textView
for now.
因为我听说过的谷歌IO视频(并且由于皮棉告诉我),它的建议能有一个样式被用于所有活动:
as i've heard in google IO videos (and since Lint tells me) , it's recommended to have the next style being used for all of the activities:
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppTheme" parent="@style/Theme.Sherlock">
<item name="android:windowBackground">@null</item>
</style>
</resources>
这为我工作在许多设备上。
this has worked for me on many devices .
然而,在模拟器上,使用2.3.3版本,并在Galaxy Nexus的,当我滚动(无论是 viewPager
或任何 adapterViews
),一切都只是涂片,所以我得到了很多的白色像素,好像什么也没有刷新。
however , on the emulator , using version 2.3.3 , and on galaxy nexus , when i scroll (either the viewPager
or any of the adapterViews
) , everything just smears , so i get a lot of white pixels as if nothing was refreshed.
我甚至尝试设置机器人:cacheColorHint =#00000000
对我所有的adapterViews,但它仍然出现
i've even tried to set android:cacheColorHint="#00000000"
for all of my adapterViews , but it still occurs.
这是怎么回事?如何解决这件事?我喜欢将上述因为它消除银河S3的丑陋的渐变背景出现的每一个应用程序。
what is going on? how can i fix this thing ? i like adding the above since it removes the ugly gradient background of galaxy S3 that appears for every app.
推荐答案
您应该只设置背景,如果你用别的东西覆盖到NUL。或者: - 将背景设置为空的主题,并在布局中添加一个新的背景 要么 - 在你的主题你想要的颜色/图像设置背景
You should only set the background to nul if you cover it with something else. Either: - Set the background to null in the theme and add a new background in your layout or - Set the background in your theme to the color/image you want.
这篇关于设置机器人:windowBackground到@null使滚动涂抹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!