androidstudio在xml中有两个相同的按钮,但只有一个有阴影

androidstudio在xml中有两个相同的按钮,但只有一个有阴影,android,Android,在我的登录活动中,我有两个按钮。它们在XML中具有完全相同的属性,但只有上方按钮下方有阴影。下图说明了这一点 下面是布局的XML <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" andro

在我的登录活动中,我有两个按钮。它们在XML中具有完全相同的属性,但只有上方按钮下方有阴影。下图说明了这一点

下面是布局的XML

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:gravity="center_horizontal"
          android:orientation="vertical"
          android:paddingBottom="@dimen/activity_vertical_margin"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin"
          android:paddingTop="@dimen/activity_vertical_margin">

<!-- Login progress -->
<ProgressBar
    android:id="@+id/login_progress"
    style="?android:attr/progressBarStyleLarge"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="8dp"
    android:visibility="gone"/>

<ScrollView
    android:id="@+id/login_form"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/email_login_form"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <AutoCompleteTextView
                android:id="@+id/email"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/email"
                android:inputType="textEmailAddress"
                android:maxLines="1"/>

        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <EditText
                android:id="@+id/password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/password"
                android:imeActionId="@+id/login"
                android:imeActionLabel="@string/login"
                android:imeOptions="actionUnspecified"
                android:inputType="textPassword"
                android:maxLines="1"/>

        </android.support.design.widget.TextInputLayout>

        <Button
            android:id="@+id/signInButton"
            style="?android:textAppearanceSmall"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="@string/login"
            android:textStyle="bold"/>

        <Button
            android:id="@+id/continueAsLoggedOutButton"
            style="?android:textAppearanceSmall"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="@string/continue_as_logged_out"
            android:textStyle="bold"/>

    </LinearLayout>
</ScrollView>


原因是什么?

如评论所述,我在
按钮上添加了
布局_marginBottom
,它解决了问题

尝试在
线性布局上添加
填充底部

可能是
线性布局
包装将其切断?您可以尝试在
线性布局
上添加
填充底部
,或在
按钮
上添加
布局_marginBottom
。谢谢,按钮的边距解决了此问题!为@+id/电子邮件登录表单添加marginBottom。滚动视图具有固定高度。。