Text("Hello $name")
Text(color = Color.Red, text = "Hello $name")
Text(color = Color(0xffff9944), text = "Hello $name")
Text(color = Color.Red, text = "Hello $name", fontSize = 30.sp)
Text(color = Color.Red, text = "Hello $name", fontSize = 30.sp, fontWeight = FontWeight.Bold)
Text(color = Color.Red,
text = "Hello $name",
fontSize = 30.sp,
fontFamily = FontFamily.Cursive
)
Text(color = Color.Red,
text = "Hello $name",
fontSize = 30.sp,
fontFamily = FontFamily.Cursive,
letterSpacing = 2.sp
)
Text(color = Color.Red,
text = "Hello $name\nHello $name\nHello $name",
fontSize = 30.sp,
fontFamily = FontFamily.Cursive,
maxLines = 2
)
Text(color = Color.Red,
text = "Hello $name\nHello $name\nHello $name",
fontSize = 30.sp,
fontFamily = FontFamily.Cursive,
maxLines = 2,
textDecoration = TextDecoration.Underline
)
10.textAlign을 TextAlign.Center로 지정하자.
modifier = Modifier.width(300.dp)나
modifier = Modifier.size(300.dp)를 설정해서 충분히 넓혀둡니다.
Text(
modifier = Modifier.width(300.dp),
color = Color.Red,
text = "Hello $name\nHello $name\nHello $name",
fontSize = 30.sp,
fontFamily = FontFamily.Cursive,
maxLines = 2,
textDecoration = TextDecoration.Underline,
textAlign = TextAlign.Center
)