当前位置:网站首页>Compose LazyColumn 顶部添加控件
Compose LazyColumn 顶部添加控件
2022-07-03 18:37:00 【安果移不动】

LazyColumn(content = {
item { Text("Headers") }
// stickyHeader { Text("Headers") }
items(names) { name ->
Greeting(name)
}
})顶部会跟随滑动。如果想黏住不跟着滑动 可以使用
stickyHeader

非常好用
同样的也可以放到底部

于是空态图的写法我们也可以用这个条目
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun Greetings(names: List<String> = List(0) { "$it" }) {
Surface(color = MaterialTheme.colors.surface) {
Column {
LazyColumn(content = {
if (names.isNotEmpty()) {
items(names) { name ->
Greeting(name)
}
} else {
item {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Text("没有数据啊")
}
}
}
})
}
}
}边栏推荐
- Why can deeplab v3+ be a God? (the explanation of the paper includes super detailed notes + Chinese English comparison + pictures)
- [combinatorics] generating function (example of generating function | calculating generating function with given general term formula | calculating general term formula with given generating function)
- Database creation, addition, deletion, modification and query
- 189. Rotation array
- shell 脚本中关于用户输入参数的处理
- Chisel tutorial - 06 Phased summary: implement an FIR filter (chisel implements 4-bit FIR filter and parameterized FIR filter)
- Sensor 调试流程
- Computer graduation design PHP makeup sales Beauty shopping mall
- 12、 Service management
- [combinatorics] generating function (example of using generating function to solve the number of solutions of indefinite equation)
猜你喜欢

Why can deeplab v3+ be a God? (the explanation of the paper includes super detailed notes + Chinese English comparison + pictures)

虚拟机和开发板互Ping问题

VLAN experiment

Data analysis is popular on the Internet, and the full version of "Introduction to data science" is free to download

What problems can cross-border e-commerce sellers solve with multi platform ERP management system

2022-2028 global sepsis treatment drug industry research and trend analysis report

平淡的生活里除了有扎破皮肤的刺,还有那些原本让你魂牵梦绕的诗与远方

Real time split network (continuous update)

English grammar_ Noun classification

2022-2028 global scar care product industry research and trend analysis report
随机推荐
[combinatorics] generating function (use generating function to solve the number of solutions of indefinite equation example 2 | extended to integer solution)
After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
Unsafe类的使用
What is SQL get connection
Recommend a simple browser tab
There are several levels of personal income tax
[combinatorics] exponential generating function (example 2 of solving multiple set permutation with exponential generating function)
Graduation summary
Torch learning notes (1) -- 19 common ways to create tensor
2022-2028 global plasmid DNA cdmo industry research and trend analysis report
Analysis of the reasons why enterprises build their own software development teams to use software manpower outsourcing services at the same time
Have you learned the correct expression posture of programmers on Valentine's day?
2022-2028 global petroleum pipe joint industry research and trend analysis report
2022-2028 global aircraft head up display (HUD) industry research and trend analysis report
Implementation of cqrs architecture mode under Kratos microservice framework
SSH 远程执行命令简介
199. Right view of binary tree - breadth search
Torch learning notes (6) -- logistic regression model (self training)
Read the paper glodyne global topology preserving dynamic network embedding
How to draw non overlapping bubble chart in MATLAB