Android - 带文本字段的ScrollView会导致背景闪烁

时间:2011-06-24 19:04:26

标签: android scrollview textfield

我是Android开发新手,遇到了问题。对于我的Android Activity,我在TableLayout中有一组文本字段。在实现ScrollView之前我没有任何问题,但是使用ScrollView我发现每次选择文本字段或开始输入时我的背景都会开始闪烁黑色(使用白色背景)。我不确定这是我的代码或模拟器本身的问题。

这就是我对ScrollView的所作所为:

    <ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/ScrollView"
        android:layout_width="wrap_content"
        android:layout_height="425px">
    <TableLayout
        android:layout_height="match_parent" 
        android:layout_width="match_parent"
        android:stretchColumns="1"
        android:background="@color/background">......
.....</TableLayout>
   </ScrollView>

其他人有类似的问题吗?

1 个答案:

答案 0 :(得分:0)

是的..你犯了同样的错误。最终我发现它与你的背景属性有关。

不确定如何发生但是

  

不要使用@colour来设置背景而是使用@drawable。

确保从XML中删除所有@colour。