keepTrackOfYourStack
keepTrackOfYourStack

Reputation: 1255

how to rotate and place text so that some is rotated and some is not in jetpack compose

my current image

I have this image already.

What I am trying for is more like

enter image description here

I am new to compose, I am not quite clear on how to do this, so this my fun; thanks!

 @Composable
 fun MyDate() {

 var calendar = Calendar.getInstance()
 var month = calendar.getDisplayName(Calendar.MONTH, 
 Calendar.SHORT, Locale.getDefault())
var day = calendar.get(Calendar.DAY_OF_MONTH).toString()

Column(
    horizontalAlignment = Alignment.CenterHorizontally
) {

        Text(
            modifier = Modifier.rotate(90f),
            fontWeight = FontWeight.Bold,
            text = month
        )

    Text(text = day)
     }
 }

Upvotes: 0

Views: 739

Answers (1)

zer0day
zer0day

Reputation: 246

wrap them in a row

    Row() {
    Text(
        modifier = Modifier.rotate(90f),
        fontWeight = FontWeight.Bold,
        text = month
    )

    Text(text = day)
}

Upvotes: 1

Related Questions