Prevent EditText From Resizing If Text Is Long

A normal thing occurs to EditText widgets whenever a very long text is entered. What happens is that the width of theEditText gets resized even if you place android:layout_width=”wrap_content”.

But do not fret. There is a way to go around this. Use the attributes android:layout_width=”0dp” andandroid:layout_weight=”1″.

It also helps (but not necessary) if you ensure that the EditText is only a one-liner by adding android:singleLine=”true”.


Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *