当前位置:网站首页>Add control at the top of compose lazycolumn
Add control at the top of compose lazycolumn
2022-07-03 18:40:00 【Ango can't move】

LazyColumn(content = {
item { Text("Headers") }
// stickyHeader { Text("Headers") }
items(names) { name ->
Greeting(name)
}
})The top will slide with it . If you want to stick and not slide have access to
stickyHeader

Very easy to use
The same can also be placed at the bottom

So we can also use this entry to write the empty state diagram
@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(" There's no data ")
}
}
}
})
}
}
}边栏推荐
- Theoretical description of linear equations and summary of methods for solving linear equations by eigen
- Read the paper glodyne global topology preserving dynamic network embedding
- SSH 远程执行命令简介
- 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
- 编程中常见的 Foo 是什么意思?
- Grammaire anglaise Nom - Classification
- Computer graduation project PHP library book borrowing management system
- my. INI file not found
- JS_ Array_ sort
- [combinatorics] generating function (use generating function to solve the number of solutions of indefinite equation example 2 | extended to integer solution)
猜你喜欢

Nodejs (01) - introductory tutorial

SQL custom collation

Raft 日志复制

Summary and Reflection on the third week of winter vacation

2022-2028 global copper foil (thickness 12 μ M) industry research and trend analysis report

Zhengda futures news: soaring oil prices may continue to push up global inflation

How many convolution methods does deep learning have? (including drawings)

虚拟机和开发板互Ping问题

How to analyze the rising and falling rules of London gold trend chart

Theoretical description of linear equations and summary of methods for solving linear equations by eigen
随机推荐
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
[combinatorics] generating function (use generating function to solve the combination number of multiple sets R)
Common PostgreSQL commands
Sensor debugging process
What is SQL get connection
Unity2018 to wechat games without pictures
199. Right view of binary tree - breadth search
[combinatorics] exponential generating function (properties of exponential generating function | exponential generating function solving multiple set arrangement)
Compose LazyColumn 顶部添加控件
How does GCN use large convolution instead of small convolution? (the explanation of the paper includes super detailed notes + Chinese English comparison + pictures)
Should I be laid off at the age of 40? IBM is suspected of age discrimination, calling its old employees "dinosaurs" and planning to dismiss, but the employees can't refute it
Analysis of the reasons why enterprises build their own software development teams to use software manpower outsourcing services at the same time
Database creation, addition, deletion, modification and query
Raft log replication
2022-2028 global copper foil (thickness 12 μ M) industry research and trend analysis report
2022-2028 global sepsis treatment drug industry research and trend analysis report
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
知其然,而知其所以然,JS 对象创建与继承【汇总梳理】
Boost. Asio Library