Text align in android editext
I have the following component in my main.xml
<EditText android:id="@+id/result"
android:singleLine="tr开发者_StackOverflow社区ue"
android:layout_span="3"
android:text="0.0" />
How do i align the text to the right , as it is aligned to the left by default.
Add android:gravity="right"
to EditText
Add below tag
android:gravity="right"
android:layout_width="match_parent"
android:gravity="end"
Add these two properties to your EditText.
精彩评论