使用 Leanback 界面工具包
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
使用 Compose 打造更优质的应用
使用适用于 Android TV OS 的 Jetpack Compose 通过最少的代码创建精美的界面。
Leanback 界面工具包提供了一些类,用于使用 androidx.leanback 库构建界面。该库基于已废弃的 Material 1 设计语言,提供了一个使用 View 和 fragment 的类框架。
如需使用现代声明式界面,请改用 Compose for TV 构建电视应用。
主题
- Leanback 界面工具包库
- 开始使用现已废弃的 Leanback 界面工具包的 AndroidX 库。
- 创建目录浏览器
- 使用现已废弃的 Leanback 界面工具包构建媒体目录的浏览界面。
- 提供卡片视图
- 使用现已废弃的 Leanback 界面工具包为内容项构建卡片视图。
- 构建详情视图
- 使用现已废弃的 Leanback 界面工具包构建媒体项目的详情页面。
- 添加传输控件
- 使用现已废弃的 Leanback 界面工具包为视频播放器构建传输控件。
- 添加引导步骤
- 使用现已废弃的 Leanback 界面工具包引导用户做出一系列决定。
- 向初次使用的用户介绍您的应用
- 使用现已废弃的 Leanback 界面工具包向初次使用的用户展示如何充分利用您的应用。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Using the Leanback UI toolkit\n\nBuild better with Compose \nCreate beautiful UIs with minimal code using Jetpack Compose for Android TV OS. \n[Compose for TV →](/training/tv/playback/compose) \n\n\nThe Leanback UI toolkit provides classes for building user interfaces with the\n[androidx.leanback library](/training/tv/get-started/create#leanback). The library provides a framework of classes using views and fragments\nbased on the deprecated Material 1 design language.\n\n\nFor a modern, declarative UI, use [Compose for TV](../compose) to build\nyour TV apps instead.\n\nTopics\n------\n\n**[Leanback UI toolkit libraries](/training/tv/playback/leanback/leanback-libraries)**\n: Get started with the AndroidX libraries for the now deprecated\n Leanback UI toolkit.\n\n**[Create a catalog browser](/training/tv/playback/leanback/browse)**\n: Use the now deprecated Leanback UI toolkit to build a browsing\n interface for media catalogs.\n\n**[Provide a card view](/training/tv/playback/leanback/card)**\n: Use the now deprecated Leanback UI toolkit to build a card view for\n content items.\n\n**[Build a details view](/training/tv/playback/leanback/details)**\n: Use the now deprecated Leanback UI toolkit to build a details page for\n media items.\n\n**[Add transport controls](/training/tv/playback/leanback/transport-controls)**\n: Use the now deprecated Leanback UI toolkit to build transport controls\n for your video player.\n\n**[Add a guided step](/training/tv/playback/leanback/guided-step)**\n: Use the now deprecated Leanback UI toolkit to guide a user through a\n series of decisions.\n\n**[Introduce first-time users to your app](/training/tv/playback/leanback/onboarding)**\n: Use the now deprecated Leanback UI toolkit to show first-time users how\n to get the most out of your app."]]