I am new in Android.
Now I need EditText which should be no more than a certain size. Now I try to use this code:
<EditText
android:id="@+id/editText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:inputType="text|textMultiLine"
android:minLines="3" />
layout_height=”wrap_content” – in this case my EditText height is equal to the number of letters in it.
But I need make restriction for height for example set height for EditText no more than of center screen.
I know that we have some problem because Android use many of different screen.
Have we got a way for calculate this height. I mean the bottom border of EditText should not be more than center of screen.
Thanks a lot!
You can restrict an EditText by adding additional values
Furthermore you could add
with some kind of dp value.
I wouldn’t use other techniques for restricting the height.