请尽可能使用预定义的 Material 图标。例如,对于导航菜单按钮
对于抽屉式导航栏,请使用标准的“汉堡式”图标。请参阅
Material Design 图标
可用图标。您还可以使用 Android Studio 的 Vector Asset Studio 从 Material 图标库中导入 SVG 图标。
高度阴影和卡片
除了 X 和 Y 属性之外,Android 中的视图还具有 Z 属性。
此属性表示视图的高度,此高度决定了以下方面:
阴影的大小:Z 值越高的视图投射的阴影越大。
绘制顺序:Z 值较高的视图会显示在其他视图的上方。
图 3. 表示高度的 Z 值。
您可以为卡片式布局应用高度,这有助于您
提供 Material 外观的卡片内的信息。您可以使用
CardView微件可
创建具有默认高度的卡片。如需了解详情,请参阅
创建卡片式布局。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],[],null,["# Material Design for Android\n\nTry the Compose way \nJetpack Compose is the recommended UI toolkit for Android. Learn how to work with theming in Compose. \n[Material Design 3 →](/jetpack/compose/designsystems/material3) \n\nMaterial Design is a comprehensive guide for visual, motion, and interaction design across\nplatforms and devices. To use Material Design in your Android apps, follow the guidelines defined in\nthe [Material Design specification](https://m3.material.io/). If your app uses Jetpack\nCompose, you can use the\n[Compose Material 3](/jetpack/androidx/releases/compose-material3) library. If your app\nuses views, you can use the\n[Android Material Components](https://github.com/material-components/material-components-android)\nlibrary. \n\nAndroid provides the following features to help you build Material Design apps:\n\n- A Material Design app theme to style all your UI widgets\n- Widgets for complex views, such as lists and cards\n- APIs for custom shadows and animations\n\nMaterial theme and widgets\n--------------------------\n\nTo take advantage of the Material features, such as styling for standard UI widgets, and to\nstreamline your app's style definition, apply a Material-based theme to your app. \n**Figure 1.** Dark Material theme. \n**Figure 2.** Light Material theme.\n\nIf you use Android Studio to create your Android project, it applies a Material theme by default.\nTo learn how to update your project's theme, see\n[Styles and themes](/develop/ui/views/theming/themes).\n\nTo provide your users a familiar experience, use Material's most common UX patterns:\n\n- Promote your UI's main action with a [floating action button](/guide/topics/ui/floating-action-button) (FAB).\n- Show your brand, navigation, search, and other actions using the [app bar](/training/appbar).\n- Show and hide your app's navigation with the [navigation drawer](/training/implementing-navigation/nav-drawer).\n- Choose from the many other Material Components for your app layout and navigation, such as collapsing toolbars, tabs, a bottom nav bar, and more. To see them all, see the [Material Components for Android catalog](https://m3.material.io/components).\n\nWhenever possible, use predefined Material Icons. For example, for the navigation \"menu\" button\nfor your navigation drawer, use the standard \"hamburger\" icon. See\n[Material Design Icons](https://m3.material.io/styles/icons/overview) for a list of\navailable icons. You can also import SVG icons from the Material Icon library with Android Studio's\n[Vector Asset Studio](/studio/write/vector-asset-studio#importing).\n\nElevation shadows and cards\n---------------------------\n\nIn addition to the *X* and *Y* properties, views in Android have a *Z* property.\nThis property represents the elevation of a view, which determines the following:\n\n- The size of its shadow: views with higher *Z* values cast bigger shadows.\n- The drawing order: views with higher *Z* values appear on top of other views.\n\n**Figure 3.** The *Z* value representing elevation.\n\nYou can apply elevation to a card-based layout, which helps you display important pieces of\ninformation inside cards that provide a Material look. You can use the\n[CardView](/reference/androidx/cardview/widget/CardView) widget to\ncreate cards with a default elevation. For more information, see\n[Create a card-based layout](/guide/topics/ui/layout/cardview).\n\nFor information about adding elevation to other views, see\n[Create shadows and clip views](/training/material/shadows-clipping).\n\nAnimations\n----------\n\n**Figure 4.** A touch feedback animation.\n\nAnimation APIs let you create custom animations for touch feedback in UI controls,\nchanges in view state, and activity transitions.\n\nThese APIs let you:\n\n- Respond to touch events in your views with **touch feedback** animations.\n- Hide and show views with **circular reveal** animations.\n- Switch between activities with custom **activity transition** animations.\n- Create more natural animations with **curved motion**.\n- Animate changes in one or more view properties with **view state change** animations.\n- Show animations in **state list drawables** between view state changes.\n\nTouch feedback animations are built into several standard views, such as buttons. The animation APIs\nlet you customize these animations and add them to your custom views.\n\nFor more information, see\n[Introduction to animations](/training/animation/overview).\n\nDrawables\n---------\n\n[Try the Compose way\nWork with Drawables in Compose\narrow_forward](/jetpack/compose/graphics/images/compare)\n\nThese capabilities for drawables help you implement Material Design apps:\n\n- **Vector drawables** are scalable without losing definition and are perfect for single-color in-app icons. Learn more about [vector drawables](/guide/topics/graphics/vector-drawable-resources).\n- **Drawable tinting** lets you define bitmaps as an alpha mask and tint them with a color at runtime. See how to [add tint to drawables](/guide/topics/graphics/2d-graphics#DrawableTint).\n- **Color extraction** lets you automatically extract prominent colors from a bitmap image. See how to [select colors with the Palette API](/training/material/palette-colors)."]]