当前位置:网站首页>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("没有数据啊")
}
}
}
})
}
}
}边栏推荐
- 2022-2028 global scar care product industry research and trend analysis report
- [enumeration] annoying frogs always step on my rice fields: (who is the most hateful? (POJ hundred practice 2812)
- 2022-2028 global petroleum pipe joint industry research and trend analysis report
- The vscode code is automatically modified to a compliance code when it is formatted and saved
- [combinatorics] generating function (commutative property | derivative property | integral property)
- 22.2.14 -- station B login with code -for circular list form - 'no attribute' - 'needs to be in path selenium screenshot deviation -crop clipping error -bytesio(), etc
- Introduction to SSH Remote execution command
- Sensor 调试流程
- 图像24位深度转8位深度
- 2022-2028 global marking ink industry research and trend analysis report
猜你喜欢

Naoqi robot summary 27

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

Raft log replication

Raft 日志复制

Summary and Reflection on the third week of winter vacation
知其然,而知其所以然,JS 对象创建与继承【汇总梳理】

G1 garbage collector of garbage collector

2022-2028 global petroleum pipe joint industry research and trend analysis report
![[combinatorics] dislocation problem (recursive formula | general term formula | derivation process)*](/img/e8/67961bf8a589869bde2a0aa3e09605.jpg)
[combinatorics] dislocation problem (recursive formula | general term formula | derivation process)*

How to track the real-time trend of Bank of London
随机推荐
VLAN experiment
shell 脚本中关于用户输入参数的处理
Summary and Reflection on the third week of winter vacation
The vscode code is automatically modified to a compliance code when it is formatted and saved
Typescript official website tutorial
Torch learning notes (5) -- autograd
Getting started with JDBC
Torch learning notes (2) -- 11 common operation modes of tensor
php-fpm的max_chindren的一些误区
统计图像中各像素值的数量
How does GCN use large convolution instead of small convolution? (the explanation of the paper includes super detailed notes + Chinese English comparison + pictures)
Analysis of the reasons why enterprises build their own software development teams to use software manpower outsourcing services at the same time
硬盘监控和分析工具:Smartctl
[combinatorics] generating function (example of using generating function to solve the number of solutions of indefinite equation)
Win 11 major updates, new features love love.
Closure and closure function
Data analysis is popular on the Internet, and the full version of "Introduction to data science" is free to download
组策略中开机脚本与登录脚本所使用的用户身份
Xception for deeplab v3+ (including super detailed code comments and original drawing of the paper)
图像24位深度转8位深度