val scrollState = rememberScrollState()
Column(modifier = Modifier.fillMaxSize()) {
BoxWithConstraints(modifier = Modifier.weight(1f)) {
Surface {
Column(
modifier = Modifier
.fillMaxSize()
.verticalScroll(scrollState),
) {
ProfileHeader(
actions.toAboutMe,
scrollState,
this@BoxWithConstraints.maxHeight
)
UserInfoFields(
actions.enterArticle,
actions.toLogin,
this@BoxWithConstraints.maxHeight
)
}
}
ProfileFab(
themeViewModel = themeViewModel,
extended = scrollState.value == 0,
modifier = Modifier.align(Alignment.BottomEnd)
)
}
}
1 column 增加verticalScroll 修饰 就可以滑动起来
2 BoxWithConstraints 这个组件提供了获取 自己最大高度 与 最大宽度的方法
网友评论