Linear,高程属性被LinearLayout忽略

时间:2015-10-03 03:10:54

标签: android android-layout material-design android-elevation

我正在尝试为我的应用的各个组件添加高程,以使其更具实质性。直接在给我问题的布局下面,我有一个在其兄弟上投射阴影的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

0 个答案:

没有答案