2

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:-

My Interface

Adda
  • 431
  • 4
  • 12

1 Answers1

1

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"

It works!

Abu Yousuf
  • 4,421
  • 2
  • 23
  • 39
Adda
  • 431
  • 4
  • 12