开发者

Android: Editext start of text

How do i set the starting position of the inputted text in the ce开发者_C百科nter or anywhere but not with the leftmost part of the editext. Thank you!


use android:paddingLeft property in the xml of EditText to displace the text from leftmost part.

android:paddingLeft="10dip" // give value according to need.

You can use android:gravity="center" too but that will place your text exactly in the middle.


use android:gravity in your layout file.

i.E.:

<EditText android:layout_width="fill_parent" 
   android:layout_height="wrap_content" android:gravity="center" />
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜