使用“TextInputLayout”时,android中的布局不起作用

使用“TextInputLayout”时,android中的布局不起作用,android,Android,大家好,我是android新手,我对所有EditText都使用TextInputLayout,但为什么看起来像这个在aimage中显示的按钮没有设置,当设置错误信息时,按钮的设置要比下面的按钮更详细,这是怎么可能的。 代码是: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_

大家好,我是android新手,我对所有EditText都使用TextInputLayout,但为什么看起来像这个在aimage中显示的按钮没有设置,当设置错误信息时,按钮的设置要比下面的按钮更详细,这是怎么可能的。 代码是:

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/windowBackground">
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
        android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:id="@+id/abc"
        android:background="@color/windowBackground">

<android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_qty"
            android:layout_width="145dip"
            android:layout_height="wrap_content"
            android:layout_below="@+id/list_view_part"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true">
            <EditText
                android:layout_width="140dip"
                android:layout_height="wrap_content"
                android:id="@+id/qty"
                android:numeric="decimal"
                android:inputType="numberDecimal"
                android:hint="Item Quantity"
                android:background="@android:drawable/editbox_background"
                android:singleLine="true"/>
        </android.support.design.widget.TextInputLayout>


        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_rate"
            android:layout_width="145dip"
            android:layout_height="wrap_content"
            android:layout_below="@+id/list_view_part"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:layout_toRightOf="@+id/count"
            android:layout_toEndOf="@+id/count">
            <EditText
                android:layout_width="100dip"
                android:layout_height="wrap_content"
                android:id="@+id/rate"
                android:numeric="decimal"
                android:inputType="numberDecimal"
                android:hint="Item Rate"
                android:background="@android:drawable/editbox_background"
                android:singleLine="true" />
        </android.support.design.widget.TextInputLayout>

<Button
            style="?android:attr/buttonStyleSmall"
            android:layout_width="40dip"
            android:layout_height="40dip"
            android:text="@string/icon_add"
            android:id="@+id/add"
            android:layout_above="@+id/input_layout_price"
            android:layout_alignLeft="@+id/input_layout_price"
            android:layout_alignStart="@+id/input_layout_price"
            android:layout_toRightOf="@+id/input_layout_rate" />
    </RelativeLayout>
</ScrollView>

提前感谢

我认为红色错误文本重置了TextInputLayout元素的高度。 是否尝试将按钮的布局重力对齐设置为“顶部”,以便更改高度不会产生影响