如果文本很长,如何调整复选框文本?

时间:2018-12-21 07:00:53

标签: android android-checkbox

我有一个列表视图来显示所有复选框。复选框标题可以短也可以长。但是我打算看全文。我该如何调整大小

没有,由于该应用程序支持下面的Android 8.0,因此不支持Android 8.0库

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="45"
        android:orientation="horizontal">

        <CheckBox
            android:id="@+id/is_checked"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:maxLines="1"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/photo_layer_title"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="start|center_vertical"
            android:maxLines="1"
            android:textColor="@drawable/textview_style" />
    </LinearLayout>

1 个答案:

答案 0 :(得分:0)

将CheckBox的宽度和高度设置为wrap_context,还将行布局(复选框的父级)的宽度和高度也设置为wrap_content