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" />
精彩评论