Android-如何实现这种工具栏?
我注意到PlayStore上最近的应用程序中使用了这种工具栏,我需要实现这一点 我知道如何用XML创建一个简单的工具栏 简单工具栏Android-如何实现这种工具栏?,android,material-design,android-toolbar,Android,Material Design,Android Toolbar,我注意到PlayStore上最近的应用程序中使用了这种工具栏,我需要实现这一点 我知道如何用XML创建一个简单的工具栏 简单工具栏 <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:background="@color/ColorPrimary"
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:background="@color/ColorPrimary"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
android:theme="@style/about_toolbar"
>
...
</android.support.v7.widget.Toolbar>
...
我看起来像一个带填充的工具栏
所以我不能完全肯定。
请做过这件事的人帮帮我 cardView示例:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#bcbcbc"
>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentTop="true"
android:layout_margin="20dp"
android:background="@android:drawable/dialog_holo_light_frame"
/>
</RelativeLayout>
您是否尝试添加边距?谢谢@DavidMedenjak,边距有效,但缺少阴影和我发布的图像的UI感觉。请检查我的阴影答案检查此答案:有效,请删除第一个示例,以免混淆!我很高兴帮助你