Jetpack Compose学习 FloatingActionButton

Jetpack Compose学习 -------- FloatingActionButton 悬浮按钮

FloatingActionButton 悬浮按钮 基本使用

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

@Composable
fun FloatingActionButtonSample() {
Column(Modifier.padding(10.dp)) {
FloatingActionButton(
onClick = { },
) {
Text(text = "悬浮按钮")
}
Spacer(modifier = Modifier.height(30.dp))
ExtendedFloatingActionButton(
text = {
Text(text = "悬浮按钮")
},
icon = {
Icon(imageVector = Icons.Filled.Favorite, contentDescription = "喜爱")
},
onClick = {

},
elevation = FloatingActionButtonDefaults.elevation(8.dp),
)
}
}