Reputation: 141
I have a problem in the layout. The checkbox in the CheckedTextView is always to the right of the textview. How can I align it to the right edge of the list?
Thank you for your future answers.
Here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_launcher"/>
<CheckedTextView
android:id="@+id/checkedTextView"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeightSmall"
android:checkMark="?android:attr/listChoiceIndicatorMultiple"
android:gravity="right|center_vertical"
android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
android:textAppearance="?android:attr/textAppearanceListItemSmall" />
</LinearLayout>
Upvotes: 1
Views: 856
Reputation: 1867
Change android:layout_width="match_parent"
of your checkbox to wrap_content
.
Upvotes: 1