CheckBox没有出现在CheckedTextView中

问题描述 投票:10回答:2

当我设置我的CheckedTextView时,它没有CheckBox。这是它的xml代码:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
    <CheckedTextView
            android:id="@+id/checkedtext"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:checked="false"
            android:textSize="25dp"
            android:textColor="#FFFFFF"
            android:checkMark="@android:attr/checkMark"
            />
</RelativeLayout>
android android-relativelayout android-checkbox
2个回答
15
投票

更换

android:checkMark="@android:attr/checkMark"

通过

android:checkMark="?android:attr/textCheckMark" 

27
投票

试试:android:checkMark =“?android:attr / listChoiceIndicatorMultiple”

© www.soinside.com 2019 - 2024. All rights reserved.