Posts

Rows in Jetpack

Image
Overview Rows are used to set views horizontally. Simple Row declaration setContent { Row () { Text ( text = "Hello Raaj!" ) Text ( text = "Welcome to the world of Jetpack Compose" ) } } Row declaration with Modifier setContent { Row ( modifier = Modifier . background (Color. Gray ) . fillMaxSize () , horizontalArrangement = Arrangement. SpaceAround , verticalAlignment = Alignment. CenterVertically ) { Text ( text = "Hello Raaj!" ) Text ( text = "Welcome to the world of Jetpack Compose" ) } } Row declaration with more Modifiers setContent { Row ( modifier = Modifier . background (Color. Gray ) . fillMaxSize ( 0.5f ) . padding ( 5 . dp ) , horizontalArrangement = Arrangement. SpaceAround , verticalAlignment = Alignment. CenterVertically , ) {

Columns in Jetpack

Image
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 https://www.youtube.com/watch?v=cDabx3SjuOY&list=PLQkwcJG4YTCSpJ2NLhDTHhi6XBNfk9WiC&