This commit is contained in:
coco
2026-07-15 16:57:36 +08:00
parent 723ce1af5c
commit 95aa018b8b
314 changed files with 8910 additions and 0 deletions
@@ -0,0 +1,42 @@
<!---
This is the API of version 1.2.0
-->
# TopAppBar
A TopAppBar displays information and actions relating to the current screen and is placed at the top of the screen.
<p align="center">
<img src ="{{ site.images }}/material/topappbar/topappbar.png" height=100 width=300/>
</p>
```kotlin
@Composable
fun TopAppBarSample(){
Column {
TopAppBar(
elevation = 4.dp,
title = {
Text("I'm a TopAppBar")
},
backgroundColor = MaterialTheme.colors.primarySurface,
navigationIcon = {
IconButton(onClick = {/* Do Something*/ }) {
Icon(Icons.Filled.ArrowBack, null)
}
}, actions = {
IconButton(onClick = {/* Do Something*/ }) {
Icon(Icons.Filled.Share, null)
}
IconButton(onClick = {/* Do Something*/ }) {
Icon(Icons.Filled.Settings, null)
}
})
Text("Hello World")
}
}
```
## See also:
* [Full Example Code]({{ site.samplefolder }}/material/appbar/topappbar/TopAppBarSample.kt)