Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/195.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 无法在BottomAppBar中获取高程_Android_Material Design_Material Components_Android Bottomappbar - Fatal编程技术网

Android 无法在BottomAppBar中获取高程

Android 无法在BottomAppBar中获取高程,android,material-design,material-components,android-bottomappbar,Android,Material Design,Material Components,Android Bottomappbar,如何获取BottomAppBar的高程。我认为默认情况下,它的海拔高度为8dp,但我没有得到任何海拔高度。 这是我的密码 <?xml version="1.0" encoding="utf-8"?> <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas

如何获取BottomAppBar的高程。我认为默认情况下,它的海拔高度为8dp,但我没有得到任何海拔高度。 这是我的密码

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <com.google.android.material.bottomappbar.BottomAppBar
        android:id="@+id/bottom_bar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:layout_gravity="bottom"
        style="@style/Widget.MaterialComponents.BottomAppBar" />

    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_anchor="@id/bottom_bar"
        android:src="@android:drawable/ic_input_add"
        android:tint="@color/colorPrimary"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>

问题的一部分在于Android上照明系统的工作方式。有一个光源从顶部和光源直接在中间。这意味着阴影在视图顶部通常不可见


我们有一个为BottomAppBar伪造阴影的错误,但它不像BottomNavigation那么简单,例如,因为晶圆厂可以移动和改变形状,所以阴影也应该改变。

你能分享一个你想要实现的图像示例吗?