android - 我看不到 ScrollView 中复选框的文本

标签 android checkbox scrollview

我在那个问题上被困了几个小时。

当我运行代码时,我在 scrollView 中看到了复选框,但我看不到它们的描述文本。

例如我需要这样的东西

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>

谢谢 /姆库纳尔

最佳答案

默认情况下,android 中的文本颜色是黑色。并且您也将布局 Backcolor 添加为黑色。那怎么可能是可见的。?

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

android:textColor = "#FFFFFF"

关于android - 我看不到 ScrollView 中复选框的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11882020/

相关文章:

android - 当关闭对话框 fragment 时,无法在 onSaveInstanceState 之后执行此操作

android - 最紧凑的 map 文件格式?

jquery - 使用 Jquery 选择列表中的所有复选框

iphone - 如何缩放 UIScrollView 的特定部分?

android - 在 android 中设计时,完整的布局不可见

java - 禁用音量、返回和通话键

java - 不兼容的 fragment 类型

javascript - 使用多个复选框进行 Jquery 过滤

python - Mechanize 复选框控件不起作用python

cocoa - 使用 ScrollView 打开 url(博客)