小编adm*_*und的帖子

ModalBottomSheetLayout is jumping on flinging in Compose 1.4.0 and above

I searching for possibility for turning OFF this "jumping"

https://www.veed.io/view/0f7585b4-529f-4700-8dc2-15788164fa44

I don't see it on Compose version below 1.4.0. My code:

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            val scope = rememberCoroutineScope()
            val sheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden)
            ModalBottomSheetLayout(
                sheetState = sheetState,
                sheetContent = {
                    Text(
                        modifier = Modifier
                            .fillMaxWidth()
                            .height(200.dp),
                        text = "CONTENT"
                    )
                }
            ) {
                Button(onClick = { scope.launch { sheetState.show() } }) {
                    Text(text = "MODAL")
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

I …

android bottom-sheet android-jetpack-compose

6
推荐指数
1
解决办法
223
查看次数