为什么复选框文本不会通过Android出现:文本,是否有任何原因



复选框文本未通过android:text。通过更改文本颜色而闻名,但结果相同。为什么会发生这种情况?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/tools"
android:id="@+id/ll_parent_adapter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
    android:id="@+id/resudlt_cv"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginLeft="4dp"
    android:layout_marginRight="4dp"
    android:layout_marginTop="4dp"
    app:cardElevation="20dp"
    app:cardPreventCornerOverlap="true">
  <LinearLayout
    android:visibility="gone"
    android:id="@+id/llCheckBox"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:orientation="horizontal">
    <CheckBox
        android:id="@+id/checkBoxMarkAsComplete"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:text="Mark as complete"
        android:textColor="@color/colorBlack"
        android:buttonTint="@color/colorVendorCheckBox"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>

根据请求给出以上完整的XML。

您设置了layout_width来修复30dp的值。尝试将复选框宽度设置为wrap_content.

最新更新