I'm building a custom composable function view inside which I used Row composable, however I want to align the right icon to right end of the Row(align to the end of the parent)
below is my code:
Row(modifier = Modifier
.fillMaxWidth()
.wrapContentHeight()
.padding(vertical = Spacing30),
verticalAlignment = Alignment.CenterVertically) {
Icon(modifier = Modifier.padding(vertical = 14.dp), painter = painterResource(id = R.drawable.ic_wallet),
contentDescription
= "limit_type")
Text(text = "₹10,000", style = Typography.TitleSecondary.copy(color = ContentPrimary))
Icon(painter = painterResource(id = R.drawable.ic_chevron_right),
contentDescription
= "chevron_right")
}
In Constrained layout I could have used ConstrainedEndToEndOf = parent
In RelativeLayout I could have used alignParentRight = true
However, I want to use Row composable only, since there are more complex composable inside it.
I have used Box composable earlier in which it is very straight forward with the modifier, as explained in the linked answer, however with the Row
and Column
(align to bottom) it seems to be difficult.