Reputation: 527
As per answer here How to make edittext in Android scrollable?, why my interface became like that?
XML Coding:-
<EditText
android:id="@+id/contactMsg"
android:layout_width="288dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="390dp"
android:background="#FFF"
android:drawableLeft="@drawable/ic_action_clipboards"
android:ems="10"
android:hint="Message"
android:scrollbars="vertical"
android:maxLines = "5"
android:padding="2dp"
android:textSize="18sp" />
Java Coding:-
yourMessage.setScroller(new Scroller(this));
yourMessage.setMaxLines(1);
yourMessage.setVerticalScrollBarEnabled(true);
yourMessage.setMovementMethod(new ScrollingMovementMethod());
My interface became like this:-
Upvotes: 2
Views: 60
Reputation: 527
Thank God! I got it.. I just have to throw away this coding in my XML Coding:-
android:scrollbars="vertical"
android:maxLines = "5"
And put this coding:-
android:inputType="textMultiLine"
Upvotes: 1