当前位置:网站首页>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("没有数据啊")
}
}
}
})
}
}
}边栏推荐
- 平淡的生活里除了有扎破皮肤的刺,还有那些原本让你魂牵梦绕的诗与远方
- What London Silver Trading software supports multiple languages
- Summary and Reflection on the third week of winter vacation
- Multifunctional web file manager filestash
- 2022-2028 global marking ink industry research and trend analysis report
- Use of unsafe class
- How to quickly view the inheritance methods of existing models in torchvision?
- Torch learning notes (5) -- autograd
- Coordinate layer conversion tool (video)
- [combinatorics] exponential generating function (example of exponential generating function solving multiple set arrangement)
猜你喜欢
![[untitled]](/img/83/5a57ed90aaafde94db600246256867.jpg)
[untitled]

CTO and programmer were both sentenced for losing control of the crawler

Analysis of the reasons why enterprises build their own software development teams to use software manpower outsourcing services at the same time

Gao Qing, Beijing University of Aeronautics and Astronautics: CIM is a natural quantum computing platform for graph data processing

Grammaire anglaise Nom - Classification

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

The vscode code is automatically modified to a compliance code when it is formatted and saved

FBI 警告:有人利用 AI 换脸冒充他人身份进行远程面试

4. Load balancing and dynamic static separation

Redis cache avalanche, penetration, breakdown
随机推荐
[combinatorics] generating function (positive integer splitting | repeated ordered splitting | non repeated ordered splitting | proof of the number of repeated ordered splitting schemes)
CTO and programmer were both sentenced for losing control of the crawler
An academic paper sharing and approval system based on PHP for computer graduation design
Unsafe类的使用
Gao Qing, Beijing University of Aeronautics and Astronautics: CIM is a natural quantum computing platform for graph data processing
[combinatorics] generating function (positive integer splitting | basic model of positive integer splitting | disordered splitting with restrictions)
2022-2028 global aircraft head up display (HUD) industry research and trend analysis report
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
Count the number of pixel values in the image
[combinatorics] generating function (use generating function to solve the number of solutions of indefinite equation example 2 | extended to integer solution)
Transformer T5 model read slowly
Read the paper glodyne global topology preserving dynamic network embedding
SSH 远程执行命令简介
How to track the real-time trend of Bank of London
Zero length array
Opencv learning notes (continuously updated)
Introduction to SSH Remote execution command
Raft 日志复制
Real time split network (continuous update)
Torch learning notes (2) -- 11 common operation modes of tensor