Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text in CheckedTextView can't be centered

 <CheckedTextView
            android:id="@+id/charge_industry_textView"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:drawableTop="@drawable/charge3"
            android:gravity="center"
            android:text="@string/ChargeIndustry"
            android:background="@drawable/checkedtextview_checked"/>

enter image description here

The text in the CheckedTextView can't be centered, when I make android:gravity="center"

like image 788
Caelan Avatar asked May 24 '16 02:05

Caelan


1 Answers

try android:layout_centerHorizontal="true"

or android:textAlignment="center"

like image 191
Vishwesh Jainkuniya Avatar answered Nov 15 '22 05:11

Vishwesh Jainkuniya