Bpn*_*Bpn 10 android sticky-footer android-jetpack-compose android-compose-lazyfor
我想使用 jetpack compose 来实现这一点。
A是行项目的可滚动列表。当A小于屏幕(或父级)尺寸时,B(页脚)应放置在最后一行下方。当A + B大于屏幕尺寸时,B固定在底部,A内容可滚动。我想知道是否有简单的方法可以使用 compose ConstraintLayout 来实现此目的。
Pun*_*rma 10
有很多方法可以做到这一点,但最有效的方法是使用ViewbottomBar的属性Scaffold。
例如:
@Composable
fun RenderContent() {
Scaffold(
topBar = { /* Your app bar goes here */ },
bottomBar = { /* Anything you place in here will be stick to the bottom. */ }
) {
// ... Rest of the content
// Benefits: If you make the content scrollable and
// the `bottomBar` composable remain on top of the content
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9417 次 |
| 最近记录: |