如何旋转和放置文本,以便一些旋转而一些不在 Jetpack Compose 中
how to rotate and place text so that some is rotated and some is not in jetpack compose
这张图片我已经有了。
我想要的更像是
我是作曲新手,不太清楚该怎么做,所以这是我的乐趣;谢谢!
@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)
}
}
将它们排成一行
Row() {
Text(
modifier = Modifier.rotate(90f),
fontWeight = FontWeight.Bold,
text = month
)
Text(text = day)
}
这张图片我已经有了。
我想要的更像是
我是作曲新手,不太清楚该怎么做,所以这是我的乐趣;谢谢!
@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)
}
}
将它们排成一行
Row() {
Text(
modifier = Modifier.rotate(90f),
fontWeight = FontWeight.Bold,
text = month
)
Text(text = day)
}