【发布时间】:2021-06-17 13:55:33
【问题描述】:
我正在通过各种方式对餐厅进行分类,并且使用了看起来很旧的溢出菜单。我想像给定的图片一样改变它。
<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout 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"
android:forceDarkAllowed="false"
android:id="@+id/main_drawer_layout">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_coo_layout"
>
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/main_appbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
>
<androidx.appcompat.widget.Toolbar
android:background="@color/tomato_red"
android:id="@+id/main_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
android:elevation="0dp"
app:layout_scrollFlags="scroll|enterAlways"
app:title="All Restaurants"
/>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@+id/main_frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.navigation.NavigationView
android:id="@+id/main_navigation_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:menu="@menu/main_menu"
app:headerLayout="@layout/main_menu_header"
android:layout_gravity="start"/>
</androidx.drawerlayout.widget.DrawerLayout>
要在此处进行哪些更改才能获得所需的结果。
【问题讨论】:
-
它们被称为芯片:在这里阅读更多关于它们的信息material.io/components/chips/android#using-chips
标签: android android-studio kotlin