Open SureshCS-50 opened 9 years ago
try this, it worked for me.
<com.rey.material.widget.EditText
android:id="@+id/etContent"
style="@style/Material.Widget.EditText.Light"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top|left"
android:hint="Your content here"
android:inputType="textMultiLine"
android:lines="6"
android:maxLines="7"
android:minLines="5"
android:scrollbars="vertical"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Body1"
app:et_inputId="@+id/etContent"
app:et_supportMode="none" />
Note: add this line: xmlns:app="http://schemas.android.com/apk/res-auto" to your parent layout
Fine, I override that EditText's mInputView.. and it is working great.. :)
Now in my code like earlier just by doing editText.setSingleLine(false); will make my editText multiline support.
public class CustomEditText extends EditText {
public CustomEditText(Context context) {
super(context);
}
public CustomEditText(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomEditText(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public CustomEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
public void setSingleLine(boolean singleLine){
mInputView.setSingleLine(singleLine);
}
}
I am creating my Edittext through code.. like..
now i need to make this as multi line support.. I don't know how to do it..