我使用标准的 Android 工具栏 android.support.v7.widget.Toolbar
https://developer.android.com/reference/android/support/v7/widget/Toolbar.html
我想将此工具栏放在屏幕底部 => 我希望阴影位于工具栏的顶部而不是底部。
我该怎么做?
谢谢!
最佳答案
您可以在drawables文件夹中定义以下渐变
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#000"
android:angle="90"
/>
</shape>
然后在布局中使用它,如下所示
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="bottom">
</android.support.v7.widget.Toolbar>
<View android:background="@drawable/drop_shadow_tab"
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_gravity="bottom"
android:layout_marginBottom="50dp"/>
</FrameLayout>
这可能就是你想要的。 :)
关于java - Android工具栏: shadow on top instead of bottom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41703077/