TopAppBar、MediumTopAppBar、LargeTopAppBar、CenterAlignedTopAppBar 用于的顶部 AppBar,BottomAppBar 用在底部的 AppBar。TopAppBar 主要是三部分,从左至右依次是:navigationIcon、title 、actions,BottomAppBar 一种是自己定义要显示的内容,一种是通过 actions 设置,并可以设置 floatingActionButton。
示例代码:
1 |
|
写 Preview 技巧,输入 prev 等出现提示按回车键。
Demo:https://www.8ug.icu/search/tags/jetpack-compose-tutorial 中的 AppBarScreen。