android:fix input gravity

This commit is contained in:
pengfei.zhou 2020-05-06 15:10:31 +08:00 committed by osborn
parent 87d9039b27
commit 8db686b89b

View File

@ -54,6 +54,8 @@ public class InputNode extends ViewNode<EditText> implements TextWatcher, View.O
EditText editText = new EditText(getContext()); EditText editText = new EditText(getContext());
editText.addTextChangedListener(this); editText.addTextChangedListener(this);
editText.setOnFocusChangeListener(this); editText.setOnFocusChangeListener(this);
editText.setBackground(null);
editText.setGravity(Gravity.START | Gravity.TOP);
return editText; return editText;
} }
@ -86,7 +88,7 @@ public class InputNode extends ViewNode<EditText> implements TextWatcher, View.O
view.setTextColor(prop.asNumber().toInt()); view.setTextColor(prop.asNumber().toInt());
break; break;
case "textAlignment": case "textAlignment":
view.setGravity(prop.asNumber().toInt() | Gravity.CENTER_VERTICAL); view.setGravity(prop.asNumber().toInt());
break; break;
case "hintText": case "hintText":
view.setHint(prop.asString().toString()); view.setHint(prop.asString().toString());