【问题标题】:How to create an external shadow at the top of my layout?如何在我的布局顶部创建外部阴影?
【发布时间】:2019-04-26 07:31:41
【问题描述】:

我想在 Android 中的视图顶部创建外部阴影。

  <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <LinearLayout
                android:id="@+id/layout2"
                android:layout_weight="1"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

            </LinearLayout>
            <LinearLayout
                android:id="@+id/layout1"
                android:layout_weight="1"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

            </LinearLayout>
        </LinearLayout>

如何在布局layout1的外部顶部制作阴影?

【问题讨论】:

    标签: android android-layout android-widget android-linearlayout shadow


    【解决方案1】:

    在布局中使用海拔属性:

    android:elevation="3dp"
    

    【讨论】:

    • 如果可能,请提供更多上下文。也许带有阴影的 LinearLayout 的屏幕截图会有所帮助。
    猜你喜欢
    • 2020-09-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-05
    • 1970-01-01
    • 2020-07-14
    • 1970-01-01
    • 2016-10-06
    相关资源
    最近更新 更多