Android How to set multiple gravity values ​​programmatically in Kotlin?

In Java, it was like:

layoutParams.setGravity(Gravity.END|Gravity.BOTTOM);

How to do it in Kotlin?

+4
source share
1 answer

This operator is called "bitwise" or "has an analog in Kotlin." Use it like this:

layoutParams.gravity = Gravity.END or Gravity.BOTTOM
+9
source

Source: https://habr.com/ru/post/1660685/


All Articles