fix: 待办内容过长导致页面内容不可见的问题
This commit is contained in:
parent
7ef264509f
commit
8cbf9fbcb6
3 changed files with 10 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package cn.super12138.todo.ui.navigation
|
||||
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||
|
|
@ -22,7 +23,8 @@ fun ToDoNavigation(
|
|||
) {
|
||||
composable(ToDoScreen.Main.name) {
|
||||
MainPage(
|
||||
viewModel = viewModel()
|
||||
viewModel = viewModel(),
|
||||
modifier = Modifier.fillMaxSize()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ fun MainPage(viewModel: MainViewModel, modifier: Modifier = Modifier) {
|
|||
}
|
||||
}
|
||||
},
|
||||
modifier = modifier.fillMaxSize()
|
||||
modifier = modifier
|
||||
) { innerPadding ->
|
||||
Column(modifier = Modifier.padding(innerPadding)) {
|
||||
ProgressFragment(
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import androidx.compose.foundation.layout.Spacer
|
|||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.FilledTonalButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
|
|
@ -52,14 +54,16 @@ fun TodoBottomSheet(
|
|||
) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.padding(horizontal = 16.dp)
|
||||
modifier = Modifier
|
||||
.padding(horizontal = 16.dp)
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(if (toDo != null) R.string.title_edit_task else R.string.action_add_task),
|
||||
style = MaterialTheme.typography.headlineMedium
|
||||
)
|
||||
|
||||
Spacer(Modifier.size(25.dp))
|
||||
Spacer(Modifier.size(20.dp))
|
||||
|
||||
var text by rememberSaveable { mutableStateOf(toDo?.content ?: "") }
|
||||
var isError by rememberSaveable { mutableStateOf(false) }
|
||||
|
|
|
|||
Loading…
Reference in a new issue