问题是打字时的文字超出了EditText的界限!如何根据EditText的宽度(权重),动态限制maxLength?
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryDark"
android:id="@+id/activity_1_cnstr_layout_main">
<LinearLayout
android:id="@+id/l_layout_1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:layout_marginTop="10dp">
<EditText
android:id="@+id/editText_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:text="Text1" />
<EditText
android:id="@+id/editText_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:ems="10"
android:inputType="textPersonName"
android:text="Text2" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>