I added a Text() inside the topAppBar right side.
TopAppBar having 3 elements left back button center title and right side clickable Text.
But the Texts clikable event not triggering. Same thing works if i put Text out side the TopAppBar.
How to achieve the clickable Text inside TopAppBar.
TopAppBar(backgroundColor = backgroundColor) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(5.dp),
horizontalArrangement = Arrangement.Absolute.SpaceAround,
verticalAlignment = Alignment.CenterVertically
) {
Image(
)
Text(
)
Text(
text = "cancel",
modifier = Modifier
.wrapContentWidth()
.padding(end = 16.dp)
.clickable(
enabled = true,
onClick = {
//navigate to different screen
}
),
textAlign = TextAlign.Right
)
}
}