If you want to create a simple top bar in compose here is the code breakdown.

@Composable
fun SimpleTopBar(screenName:String) {
    TopAppBar(
        title = {
            Text(text = screenName)
        },
        modifier = Modifier
            .systemBarsPadding(), // This is equivalent to android:fitsSystemWindows="true" ,
        backgroundColor = Color.Blue,
        contentColor = Color.White,

    )
}

You may also like...

0 Comments

No Comment.