当前位置:网站首页>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 ")
}
}
}
})
}
}
}
边栏推荐
- Zero length array
- NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
- Administrative division code acquisition
- Computer graduation design PHP campus address book telephone number inquiry system
- FBI warning: some people use AI to disguise themselves as others for remote interview
- Why can deeplab v3+ be a God? (the explanation of the paper includes super detailed notes + Chinese English comparison + pictures)
- 204. Count prime
- Torch learning notes (3) -- univariate linear regression model (self training)
- 2022.02.11
- After nohup NPM start &, close the shell window directly, and the process closes accordingly
猜你喜欢
What kind of experience is it when the Institute earns 20000 yuan a month?
论文阅读 GloDyNE Global Topology Preserving Dynamic Network Embedding
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
Chisel tutorial - 06 Phased summary: implement an FIR filter (chisel implements 4-bit FIR filter and parameterized FIR filter)
Nodejs (01) - introductory tutorial
2022-2028 global lithium battery copper foil industry research and trend analysis report
Computer graduation design PHP campus address book telephone number inquiry system
12、 Service management
Torch learning notes (7) -- take lenet as an example for dataload operation (detailed explanation + reserve knowledge supplement)
随机推荐
Multifunctional web file manager filestash
Change the single node of Postgres database into master-slave
What is the function of registering DLLs- What does registering a DLL do?
PHP determines which constellation it belongs to today
How to draw non overlapping bubble chart in MATLAB
Administrative division code acquisition
[combinatorics] generating function (example of using generating function to solve the number of solutions of indefinite equation)
ES7 - Optimization of promise
[combinatorics] exponential generating function (concept of exponential generating function | permutation number exponential generating function = combinatorial number ordinary generating function | e
Common PostgreSQL commands
[enumeration] annoying frogs always step on my rice fields: (who is the most hateful? (POJ hundred practice 2812)
Xception for deeplab v3+ (including super detailed code comments and original drawing of the paper)
Naoqi robot summary 27
Unity2018 to wechat games without pictures
What is SQL get connection
Nodejs (01) - introductory tutorial
Computer graduation project PHP library book borrowing management system
Raft 日志复制
2022-2028 global lithium battery copper foil industry research and trend analysis report
[leetcode周赛]第300场——6110. 网格图中递增路径的数目-较难