Page 1 of 1

So richten Sie die Ansicht am Ende im Zeilen -Jetpack komponieren

Posted: 18 May 2025, 22:14
by Anonymous
Ich möchte am Ende des Bildschirms die Ansicht machen. So etwas wie dieses
Erwartete Ausgabe

Ich habe kein Stück Code gearbeitet, aber es arbeitet kein Stück, aber es arbeitet kein Stück Code, das Code funktioniert, aber es arbeitet kein Stück Code.

Code: Select all

@Preview(showBackground = true)
@Composable
fun Xyz(
title: String = "Hello world",
subTitle: String = "How are you?",
showImage: Boolean = true
) {
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
) {
Icon(Icons.Rounded.ShoppingCart, contentDescription = null)
Column(Modifier.padding(start = dimensionResource(R.dimen.home_progress_test_in_progress_padding))) {
AnimatedVisibility(visible = title.isNotEmpty()) {
Text(text = title, maxLines = 1, overflow = TextOverflow.Ellipsis)
}
AnimatedVisibility(visible = subTitle.isNotEmpty()) {
Text(text = subTitle, maxLines = 1, overflow = TextOverflow.Ellipsis)
}
}
AnimatedVisibility(visible = showImage) {
Image(
Icons.Rounded.AccountBox,
contentDescription = null
)
}
}
}
Tatsächliche Ausgabe

Ich versuche, modifier zu add modifier.align (end). Fehler < /p>

Code: Select all

    AnimatedVisibility(
modifier = Modifier.align(End),
visible = showImage
) {
Image(
Icons.Rounded.AccountBox,
contentDescription = null
)
}