Alexandru Gheorghe
08/14/2024, 3:58 PMBox
composable with a TopAppBar on top of it. For some reason, there's a space between the image displayed and the top edge of the screen (just below status bar) and as well at the bottom edge just before other composables start. Anyone ran into this issue? Screenshot in 🧵Alexandru Gheorghe
08/14/2024, 4:00 PMChrimaeon
08/14/2024, 4:12 PMcontentScale
Alexandru Gheorghe
08/14/2024, 6:48 PMcontentScale
, but all of them (Crop, Fit, FitHeight) failed to close the gaps.Alexandru Gheorghe
08/14/2024, 6:52 PMBox(
modifier = modifier
.height(300.dp)
) {
Column(
modifier = Modifier
.fillMaxWidth()
.align(Alignment.Center),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
if (photoUri != null && !deleteImage) {
Box(
contentAlignment = Alignment.Center
) {
/** Show selected image */
Image(
painter = rememberAsyncImagePainter(
model = ImageRequest.Builder(context)
.data(photoUri)
.crossfade(true)
.build()
),
contentDescription = null,
contentScale = ContentScale.Crop
)
Alexandru Gheorghe
08/14/2024, 6:54 PMBox {
if (uiState == ProfileUiState.Success) {
ProfilePhoto(
modifier = modifier,
context = context,
onPhotoSelected = onPhotoSelected,
...
)
}
TopAppBar(
title = { },
modifier = modifier,
colors = TopAppBarDefaults.mediumTopAppBarColors(
containerColor = Color.Transparent
),
...
Alexandru Gheorghe
08/14/2024, 6:54 PMAlexandru Gheorghe
08/15/2024, 12:30 PMcontentScale
On both Image composable AND rememberAsyncImagePainter fixed the issue