Compose ModalBottomSheetLayout 键盘弹出时UI异常问题求助
Compose ModalBottomSheetLayout 键盘弹出时UI异常问题求助
各位好,我碰到了一个挺奇怪的UI小问题:当ModalBottomSheetLayout处于展开状态时,弹出键盘会导致键盘区域出现UI错乱的情况。
以下是我复现问题的代码:
@Composable @OptIn(ExperimentalMaterialApi::class) fun ModalBottomSheetSample() { val state = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden, skipHalfExpanded = true) val scope = rememberCoroutineScope() ModalBottomSheetLayout( sheetState = state, sheetContent = { Column(modifier = Modifier.verticalScroll(rememberScrollState())) { repeat(20) { TextField(value = "", onValueChange = {}) } } } ) { Button(onClick = { scope.launch { state.show() } }) { Text("Click to show sheet") } } }
我还录制了视频来展示这个异常现象,能直观看到键盘弹出时的UI错乱情况。
有没有大佬知道该怎么解决这个问题呀?
备注:内容来源于stack exchange,提问作者gellyke
相关产品推荐
相关产品推荐

