I have an EditText which I want to fill all the horizontal width available but the width should not be greater than 200dp
This makes EditText adapt to any screen size and still makes it look good on large screens (stretching horizontally won't look nice on a large screen).
How to do this in Android?
I saw that maxWidth=200dp
and layoutWidth=fill_parent
do not work together:
<EditText android:id="@+id/oldpassword"
android:hint="@string/youroldpassword"
android:inputType="textpassword"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:maxWidth="250dp" />
If maxWidth
and layoutWidth=fill_parent
do not work together, then what is the maxWidth
meant for?
In other words, if the EditBox does not change its width dynamically, then what would you need maxWidth
for?