我在那个问题上被困了几个小时。
当我运行代码时,我在 scrollView 中看到了复选框,但我看不到它们的描述文本。
例如我需要这样的东西
在我的应用程序中,我只能看到复选框,仅此而已。
我的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/