From the course: Complete Guide to Android Development with Kotlin for Beginners

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Display UI elements with Column, Row, and Box

Display UI elements with Column, Row, and Box

- [Instructor] Composable 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 composable. On line number 37, we have a column. This is a layout composable and is responsible for laying out its children vertically. Then we have two Text composables, one on line number 38, and one on line number 42. These Text composables display visible text to the user. It's pretty simple so far, right? We can use the preview to see how these composables will appear on screen. And if we look in the right pane, yes, we see the text elements appear, one after the other, in the order that they were defined. Layout composables like Column allow you to have a measure of customization over how the children are arranged. Let's come to our greeting function. And we're going to add a new parameter to the Column composable. HorizontalAlignment. To do that, we'll put some…

Contents