【发布时间】:2017-01-15 09:08:27
【问题描述】:
如何在同一行中使用两个TextInputLayout(Material Design),即水平,这样它们必须平等地获得线性布局中的所有水平空间。我试过线性布局
<android.support.design.widget.TextInputLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5">
<EditText
android:id="@+id/firstname"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:hint="@string/fhint"
android:inputType="textPersonName"
android:maxLength="20"
android:maxLines="1"
android:elevation="6dp"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5">
<EditText
android:id="@+id/lastname"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:hint="@string/lhint"
android:inputType="textPersonName"
android:elevation="6dp"
android:maxLines="1"
android:maxLength="15"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
【问题讨论】: