2

我正在尝试为我的应用程序的各个组件添加高程,以使其具有更多材料外观。在给我带来问题的布局正下方,我有一个 LinearLayout,它在其兄弟上投射阴影,但这个元素不会显示阴影,我不知道为什么。

<LinearLayout
    android:id="@+id/input_control_block"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:color="@color/white"
    android:elevation="8dp">

    <Button
        android:id="@+id/inputModeSelector"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="3"
        android:background="@color/cyan"
        android:clickable="true"
        android:drawableRight="@drawable/ic_assignment_white_18dp"
        android:gravity="center_vertical|left"
        android:padding="16dp"
        android:text=" Text"
        android:textColor="@color/white" />

    <ImageButton
        android:id="@+id/addNoteButton"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="2"
        android:background="@color/cyan"
        android:clickable="true"
        android:gravity="center"
        android:padding="8dp"
        android:src="@drawable/ic_add_circle_outline_white_18dp" />

    <Button
        android:id="@+id/alarmEnableButton"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="3"
        android:background="@color/cyan"
        android:clickable="true"
        android:drawableLeft="@drawable/ic_notifications_off_white_18dp"
        android:gravity="center_vertical|right"
        android:padding="16dp"
        android:text="None"
        android:textColor="#ffffff" />

</LinearLayout>

<LinearLayout
    android:id="@+id/edit_text_block"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:animateLayoutChanges="true"
    android:background="@color/white"
    android:orientation="vertical"
    android:padding="16dp">
//sibling element shadow should be cast on
4

0 回答 0