Reputation: 164
is it possible to have an EditText with multiple Lines which automatically makes a Line break after every 20th Character the user is typing in?
Upvotes: 11
Views: 22819
Reputation: 12134
In your XML file create the edittext like this,
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine" >
<requestFocus />
</EditText>
Upvotes: 55
Reputation: 4467
You can implement TextWatcher interface and implement method afterTextChanged. The method will be invoked after text changed, so you can add the line breaks in it by yourself.
Upvotes: 5