Text and Column Basics
Show and stack content.
The Text Composable
The most basic thing you can show in Compose is text. The Text composable draws a string on the screen.
You pass the string you want to display as the first argument. That's all it takes to put words on screen.
@Composable
fun Hello() {
Text("Hello, Android!")
}Styling Text
Text accepts parameters to change its look. You can set fontSize, color, and fontWeight.
Sizes use the sp unit, which scales with the user's font settings. This keeps your app readable for everyone.
Text(
"Big Title",
fontSize = 24.sp,
fontWeight = FontWeight.Bold
)All lessons in this course
- What a Composable Is
- Text and Column Basics
- Previewing Your UI
- Building a Profile Card