# LayoutElementBuilders.Column

# LayoutElementBuilders.Column

Artifact:[androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/LayoutElementBuilders.java+class:androidx.wear.protolayout.LayoutElementBuilders.Column)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/protolayout/LayoutElementBuilders.Column "View this page in Java")

<br />

```
@RequiresSchemaVersion(major = 1, minor = 0)
class LayoutElementBuilders.Column : LayoutElementBuilders.LayoutElement
```

<br />

*** ** * ** ***

A column of elements. Each child element will be laid out vertically, one after another (i.e. stacking down). This element will size itself to the smallest size required to hold all of its children (e.g. if it contains three elements sized 10x10, 20x20 and 30x30, the resulting column will be 30x60).

If specified, horizontal_alignment can be used to control the gravity inside the container, affecting the horizontal placement of children whose width are smaller than the resulting column width.

## Summary

|                                                                                                                                     ### Nested types                                                                                                                                      |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[LayoutElementBuilders.Column.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column.Builder) Builder for[Column](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column). |

|                                                                                                                                                                     ### Public functions                                                                                                                                                                      |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `(`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[LayoutElementBuilders.LayoutElement](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.LayoutElement)`!>` | [getContents](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column#getContents())`()` Gets the list of child elements to place inside this[Column](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column).                 |
| [DimensionBuilders.ContainerDimension](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension)`?`                                                                                                                                                                                                      | [getHeight](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column#getHeight())`()` Gets the height of this column.                                                                                                                                                          |
| [LayoutElementBuilders.HorizontalAlignmentProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.HorizontalAlignmentProp)`?`                                                                                                                                                                                    | [getHorizontalAlignment](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column#getHorizontalAlignment())`()` Gets the horizontal alignment of elements inside this column, if they are narrower than the resulting width of the column.                                     |
| [ModifiersBuilders.Modifiers](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Modifiers)`?`                                                                                                                                                                                                                        | [getModifiers](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column#getModifiers())`()` Gets[androidx.wear.protolayout.ModifiersBuilders.Modifiers](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Modifiers)for this element. |
| [DimensionBuilders.ContainerDimension](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.ContainerDimension)`?`                                                                                                                                                                                                      | [getWidth](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column#getWidth())`()` Gets the width of this column.                                                                                                                                                             |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                                                                                                                                                                                             | [toString](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column#toString())`()`                                                                                                                                                                                            |

## Public functions

### getContents

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun getContents(): (Mutable)List<LayoutElementBuilders.LayoutElement!>
```

Gets the list of child elements to place inside this[Column](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/LayoutElementBuilders.Column).  

### getHeight

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun getHeight(): DimensionBuilders.ContainerDimension?
```

Gets the height of this column. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).  

### getHorizontalAlignment

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun getHorizontalAlignment(): LayoutElementBuilders.HorizontalAlignmentProp?
```

Gets the horizontal alignment of elements inside this column, if they are narrower than the resulting width of the column. If not defined, defaults to HORIZONTAL_ALIGN_CENTER.  

### getModifiers

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun getModifiers(): ModifiersBuilders.Modifiers?
```

Gets[androidx.wear.protolayout.ModifiersBuilders.Modifiers](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ModifiersBuilders.Modifiers)for this element.  

### getWidth

Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)  

```
fun getWidth(): DimensionBuilders.ContainerDimension?
```

Gets the width of this column. If not defined, this will size itself to fit all of its children (i.e. a WrappedDimension).  

### toString

```
fun toString(): String
```