I know it seems it's an already thousand times answered issue but I haven't found anything that works for me.
I have a MultiLine EditText on Android that adapts to the view size by "playing" with the weight (1) and the height (0dip). I am using gravity "top" but it starts in the middle.
I guess the problem it's related with the weight. Here's the code (the parent is a LinearLayout):
<EditText
android:id="@+id/txtContacto"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_gravity="top"
android:inputType="textMultiLine"
android:weight="1">
</EditText>
<EditText
android:id="@+id/txtContacto"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:gravity="top"
android:inputType="textMultiLine"
android:weight="1">
</EditText>
try the above code.. where layout gravity sets the edittext and gravity sets the content of edittext.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With