开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜