代码之家  ›  专栏  ›  技术社区  ›  mkounal

我看不到滚动框内复选框的文本查看

  •  1
  • mkounal  · 技术社区  · 14 年前

    我在那个问题上已经陷了好几个小时了。

    当我运行代码时,我看到滚动视图中的复选框,但我看不到它们的描述文本。

    例如,我需要这样的东西

    enter image description here

    在我的应用程序中,我只能看到复选框,什么也看不到。

    我的xml文件

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#000000" >
    
        <ScrollView
            android:id="@+id/myScrollLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >
    
            <LinearLayout
                android:id="@+id/linearStoScroll"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:isScrollContainer="true"
                android:orientation="vertical" >
    
                <CheckBox
                    android:id="@+id/Sunday"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/Sunday" />
    
                <CheckBox
                    android:id="@+id/Monday"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/Monday" />
                <CheckBox
                    android:id="@+id/Tuesday"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/Tuesday" />
                <CheckBox
                    android:id="@+id/Wednesday"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/Wednesday" />
                <CheckBox
                    android:id="@+id/Thursday"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/Thursday" />
                <CheckBox
                    android:id="@+id/Friday"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/Friday" />
                <CheckBox
                    android:id="@+id/Saturday"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/Saturday" />
            </LinearLayout>
        </ScrollView>
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignBottom="@id/myScrollLayout">
    
            <Button
                android:id="@+id/ok_button_date"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:onClick=""
                android:text="OK" />
    
            <Button
                android:id="@+id/cancel_button_date"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
               android:layout_weight="1"
                android:onClick=""
                android:text="Cancel" />
        </LinearLayout>
    
    </RelativeLayout>
    

    非常感谢。 /姆库纳尔

    1 回复  |  直到 14 年前
        1
  •  3
  •   MicroEyes    14 年前

    默认情况下,android中的文本颜色为 黑色 。并且您添加了布局 背景色 同样是黑色。那么,它怎么可能是可见的呢。?

    请更改的文本颜色 复选框 变为白色

    android:textColor = "#FFFFFF"