admin管理员组文章数量:1389892
I’m implementing an Android app using Jetpack Compose. My screen has a bottom sheet that can be dragged from a partially visible state to fully expanded or fully collapsed. Behind the bottom sheet, there’s a text element that I want to fade out as the bottom sheet is dragged up and fade back in as the bottom sheet is dragged down.
Here’s what I’ve tried so far:
I used ModalBottomSheetLayout with rememberModalBottomSheetState to manage the bottom sheet’s state.
I tracked the bottom sheet’s progress using bottomSheetState.progress.fraction.
I used animateFloatAsState to animate the text’s opacity based on the bottom sheet’s progress.
本文标签:
版权声明:本文标题:android - How to fade out text behind a bottom sheet when dragging it up and fade it back in when dragging it down in Jetpack Co 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744591254a2614503.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论