1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| @Composable fun TopAppBarSample() { Column { TopAppBar( elevation = 4.dp, title = { Text("标题内容") }, backgroundColor = MaterialTheme.colors.primarySurface, navigationIcon = { IconButton(onClick = { }) { Icon(imageVector = Icons.Filled.ArrowBack, contentDescription = "返回") } }, actions = { IconButton(onClick = {}) { Icon(imageVector = Icons.Filled.Share, contentDescription = "分享") } IconButton(onClick = {}) { Icon(imageVector = Icons.Filled.Settings, contentDescription = "设置") } } ) Text(text = "Hello World") } }
|