我有一个具有以下结构的根级别可组合。
ModalBottomSheetLayout(
bottomSheetNavigator = bottomSheetNavigator,
scrimColor = MaterialTheme.colors.surface.copy(alpha = 0.5f),
sheetContentColor = Color.Transparent,
sheetBackgroundColor = Color.Transparent
) {
Scaffold(
bottomBar = {
BottomNavigator(
navController = navController,
navigationItems = bottomNavItems,
navigationDestinations = bottomNavDestinations
)
}
) {
DestinationsNavHost(
navGraph = NavGraphs.root,
navController = navController,
engine = rememberAnimatedNavHostEngine()
)
}
}
底部工作表的内容包含在此可组合物中:
@Composable
@Destination(style = DestinationStyle.BottomSheet::class)
fun TaskInputSheet(
navigator: DestinationsNavigator,
) {
val nameState = remember {
mutableStateOf("")
}
val descState = remember {
mutableStateOf("")
}
val taskTypeState = remember {
mutableStateOf(TaskType.REPS)
}
val viewModel: TaskListViewModel = viewModel()
Column(
modifier = Modifier
.padding(16.dp)
.border(
width = 2.dp,
brush = Brush.linearGradient(
listOf(
MaterialTheme.colors.primary,
MaterialTheme.colors.secondary
)
),
shape = RoundedCornerShape(16.dp)
)
.clip(RoundedCornerShape(16.dp))
.background(MaterialTheme.colors.surface),
horizontalAlignment = Alignment.CenterHorizontally
) {
// Content
}
}
我正在使用 compose destinations lib,它本身使用伴奏材料导航。导航设置得很好,我没有任何问题。
我打算在底片本身和屏幕边缘之间有一些填充。问题出在此屏幕截图中:
顶部的第一个箭头显示了一种奇怪的阴影效果,好像有一个透明的边缘,然后阴影从那个边缘开始。第二个箭头显示工作表底部和屏幕底部边缘之间没有间距,但填充正确应用于内容的开头和结尾。
我应该怎么做才能摆脱这两个?或者这是一个错误?