I have an EditText that I want to fill the entire available horizontal width, but the width should not be greater than 200dp
This makes EditText adaptable to any screen size and still makes it look good on large screens (horizontal stretching will not look beautiful on a large screen).
How to do it 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 does maxWidth mean for <? p>
In other words, if the EditBox does not change its width dynamically, then what do you need maxWidth for?
source share