Columns in Jetpack
Overview
Columns are used to set views vertically.
- Some Example of Column
setContent {
Column() {
Text(text = "Hello Raaj!")
Text(text = "Welcome to the world of Jetpack Compose")
}
}
setContent {
Column(
modifier = Modifier.background(Color.Gray) ,
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(text = "Hello Raaj!")
Text(text = "Welcome to the world of Jetpack Compose")
}
}
setContent {
Column(
modifier = Modifier
.background(Color.Gray)
.fillMaxSize() ,
horizontalAlignment = Alignment.CenterHorizontally ,
verticalArrangement = Arrangement.Center
) {
Text(text = "Hello Raaj!")
Text(text = "Welcome to the world of Jetpack Compose")
}
}
Reference
Comments
Post a Comment