三门峡市网站建设_网站建设公司_Oracle_seo优化
2026/1/2 1:15:09 网站建设 项目流程

让内容可滑动

//关键点 val scrollState = rememberScrollState() AlertDialog( containerColor = DialogBg, modifier = Modifier .widthIn(min = 400.dp) .fillMaxWidth(0.3f) //关键点 .windowInsetsPadding(WindowInsets.safeDrawing), onDismissRequest = { }, properties = DialogProperties( dismissOnBackPress = true, dismissOnClickOutside = true, // usePlatformDefaultWidth = false, // 禁用平台默认宽度,避免尺寸波动 decorFitsSystemWindows = false // 禁用系统窗口适配,减少布局冲突 ), title = { Row(verticalAlignment = Alignment.CenterVertically) { Image( painter = painterResource(R.drawable.warning), contentDescription = "菜单", modifier = Modifier.size(20.dp) ) Spacer(modifier = Modifier.width(8.dp)) Text(text = title, fontSize = 22.sp) } }, text = { //关键点 Column(modifier = Modifier.verticalScroll(scrollState)) { if (!firstPrompt.isBlank()) { CustomOutlinedTextField( label = { Text(firstStrDes) }, value = firstPrompt, singleLine = true, readOnly = true, enabled = false, onValueChange = { }, keyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Text, imeAction = ImeAction.Done ), modifier = Modifier .height(55.dp) .fillMaxWidth(0.95f), contentPadding = PaddingValues(start = 10.dp, end = 2.dp), colors = OutlinedTextFieldDefaults.customColors(), ) Spacer(modifier = Modifier.height(8.dp)) } CustomExposedDropdownMenu( modifier = Modifier .height(55.dp) .fillMaxWidth(0.95f), tempShow, labelStr, selectedOptionText = selectedOptionText ) { result -> selectedOptionTextId.value = result.getShowId() } Spacer(modifier = Modifier.height(8.dp)) CustomOutlinedTextField( label = { Text(textInputDes) }, value = editString.value, singleLine = true, onValueChange = { editString.value = it }, keyboardOptions = KeyboardOptions( keyboardType = KeyboardType.Number, imeAction = ImeAction.Done ), modifier = Modifier .height(55.dp) .fillMaxWidth(0.95f), contentPadding = PaddingValues(start = 10.dp, end = 2.dp), colors = OutlinedTextFieldDefaults.customColors(), ) } }, confirmButton = { TextButton(onClick = { if (editString.value.isEmpty()) { ToastUtil.showToast("请输入${textInputValue}") return@TextButton } // 根据选中的ID找到对应的T对象 val selectedItem = showSelectList.find { it.getShowId() == selectedOptionTextId.value } if (null == selectedItem) { ToastUtil.showToast("请选择$labelStr") return@TextButton } okClick?.invoke(selectedItem, editString.value) dialogState.value = false }) { Text(text = "确认") } }, dismissButton = { TextButton(onClick = { dialogState.value = false }) { Text(text = "取消") } }, )

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询