From the course: Android Compose with Kotlin
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Display UI elements with Column, Row, and Box - Kotlin Tutorial
From the course: Android Compose with Kotlin
Display UI elements with Column, Row, and Box
- [Instructor] Composables are functions that specify some UI element in your app. In this example, we have a composable function that shows a greeting to the user. Inside of our greeting function, we have three other composables. One is column on line number 15. This is a layout composable, and it's responsible for laying out its children vertically, similar to a linear layout. Then we have two text composable inside of it that display visible text to the user. It's pretty simple so far, right? We can use our preview to see how these composable will appear on screen. The text elements appear one after the other in the order in which they were defined. Layout composables like column allow you to customize how the children are arranged. So let's add a new parameter to the column composable. We'll come here to line number 15, and this will be inside of the parentheses. We're going to add a new parameter, and that's going to be horizontal alignment. Okay, perfect. And we're going to set…
Contents
-
-
-
Kotlin for Jetpack Compose3m 23s
-
Define screens with activities and composables2m 55s
-
(Locked)
Implement designs using composables3m 48s
-
(Locked)
Display UI elements with Column, Row, and Box4m 35s
-
(Locked)
Units of measurement with Compose2m 42s
-
(Locked)
Use modifiers to customize your layout5m 50s
-
(Locked)
Challenge: Bye-bye ConstraintLayout57s
-
(Locked)
Solution: Bye-bye ConstraintLayout2m 53s
-
-
-
-
-
-
-
-
-