androidandroid-layoutkotlinandroid-flexboxlayout

How can I set the FlexBox.alignItems to flex_end programatically?


I know how to do it in xml

app:alignItems="flex_start"

But I don't know were to find the reference to flex_end programmatically.

For example this code (in kotlin) makes the entire layout blank. But when I search the project for "flex_box" the only place i see it is int the R file. So how do I set alignItems = .flex_end?

init {
    flexDirection = FlexDirection.ROW
    flexWrap = FlexWrap.WRAP
    alignItems = R.id.flex_end
}

Solution

  • Try Using

        JustifyContent.FLEX_END