Reputation:
I am making an app in which i have to use edit text and when i use this text on samsung galaxy s and emulator , the text starts from center of edittext rather than starting from top.The screen shot and code is as follows`
<EditText android:id="@+id/tester"
android:layout_height="113dip"
android:layout_width="420dip"
android:background="@drawable/textarea_reason"
android:paddingTop="-90dip"/>
`
Upvotes: 3
Views: 11126
Reputation: 19796
You need to change gravity parameter.
Java Code
editText.setGravity(Gravity.TOP| Gravity.LEFT);
XML
<EditText
android:id="@+id/tester"
android:layout_height="113dip"
android:layout_width="420dip"
android:background="@drawable/textarea_reason"
android:gravity="top|left"/>
Upvotes: 12
Reputation: 11211
Try setting edit text's properties singleLine="false"
in the xml or minLines
to > 1
Upvotes: 0
Reputation: 1807
Update yor Edit Text tag like as...
<EditText
android:id="@+id/tester"
android:layout_height="113dip"
android:layout_width="420dip"
android:background="@drawable/textarea_reason"
android:gravity="top|left"/>
Upvotes: 5
Reputation: 1932
You have set Back ground image thats why this problem occurs put android:paddingLeft="20dp" and test
Upvotes: 0