创建了一个模态底部表单。当底部工作表启动时对讲开启时尝试获得焦点。它不起作用。此外,当移动焦点时,它还会关注底部工作表后面视图中的组件。 知道出了什么问题吗?
@ExperimentalMaterialApi
@Composable
fun BottomSheetExample(
contents: @Composable () -> Unit
) {
val focusRequest = FocusRequester()
ModalBottomSheetLayout(
sheetState = rememberModalBottomSheetState(initialValue = ModalBottomSheetValue.Hidden),
sheetContent = {
Column {
Text(
modifier = Modifier
.fillMaxWidth()
.padding(start = 30.dp, end = 30.dp, top = 21.dp, bottom = 21.dp),
text = "Text Sample 1",
fontSize = 16.sp,
color = colorResource(id = R.color.johnstonBlack)
)
Text(
modifier = Modifier
.fillMaxWidth()
.padding(start = 30.dp, end = 30.dp, top = 21.dp, bottom = 21.dp)
.focusRequester(focusRequest)
.focusable(),
text = "Text Sample 2",
fontSize = 16.sp,
color = colorResource(id = R.color.johnstonBlack)
)
Text(
modifier = Modifier
.fillMaxWidth()
.padding(start = 30.dp, end = 30.dp, top = 21.dp, bottom = 21.dp),
text = "Text Sample 3",
fontSize = 16.sp,
color = colorResource(id = R.color.johnstonBlack)
)
}
},
content = {
contents()
}
)
}
https://issuetracker.google.com/issues/349132653
面对同样的问题,我根据这篇文章创建了一个问题跟踪器。请发表评论并分享您对票证的见解,以便我们找到解决方案。