Moh*_*mad 5 user-interface android overlap kotlin android-jetpack-compose
我想实现这个用户界面。如何在 android jetpack compose 中相互重叠发布列表项?
小智 20
如果您使用 Column 或 LazyList 来显示项目,则可以使用带有负 spacedBy 空格的 VerticalArrangement 参数。
LazyColumn(
verticalArrangement = Arrangement.spacedBy((-32).dp)
) {
// Put the items to overlap here
}
Run Code Online (Sandbox Code Playgroud)
小智 8
您可以使用Box
样本 :
Box(modifier = Modifier.fillMaxSize()) {
Image(modifier = Modifier.fillMaxSize()) {} //Image1
Image(modifier = Modifier.fillMaxSize()) {} //Image2
}
Run Code Online (Sandbox Code Playgroud)
在上面的示例中,Image2 将覆盖 Box 的 maxSize。Image1 将位于 Image2 下方。