How To Align The Checkboxes In The CheckedtextView In Android
I have a scrollView containing a form composed by multiple CheckedTextView, my problem is that the check boxes of these ones are not in the same level, they are at this end of ever
Solution 1:
This may solve the purpose
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<CheckedTextView
android:id="@+id/my_checkedtextview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:checked="true"
android:clickable="true"
android:gravity="left|center_vertical"
android:hint="My text one" />
<CheckedTextView
android:id="@+id/my_checkedtextview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:checked="true"
android:clickable="true"
android:gravity="left|center_vertical"
android:hint="Trying a larger text " />
<CheckedTextView
android:id="@+id/my_checkedtextview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:checked="true"
android:clickable="true"
android:gravity="left|center_vertical"
android:hint="Checked" />
<CheckedTextView
android:id="@+id/my_checkedtextview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:checked="true"
android:clickable="true"
android:gravity="left|center_vertical"
android:hint="text with some more text" />
<CheckedTextView
android:id="@+id/my_checkedtextview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:checked="true"
android:clickable="true"
android:gravity="left|center_vertical"
android:hint="Checked" />
<CheckedTextView
android:id="@+id/my_checkedtextview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:checked="true"
android:clickable="true"
android:gravity="left|center_vertical"
android:hint="Checked" />
</LinearLayout>
</ScrollView>
Also attached the output.
Solution 2:
As a solution, I used single checkboxes
and textviews
Post a Comment for "How To Align The Checkboxes In The CheckedtextView In Android"