Layout Editor for Android Studio ConstraintLayout: package vs chain

In the Android Studio Layout Editor, I see the words “pack” and “chain” relative ConstraintLayout. I know that they both have something to do with several views connected to each other on the same line, but their difference is not clear to me.

enter image description here

enter image description here

enter image description here

What is the difference between a package and a chain?

+6
source share
1 answer

Short answer

A - , . , , .. ( ).

Pack , . , , .

enter image description here

:

  • .
  • .

    • , , . enter image description here
    • , packed .

      app:layout_constraintHorizontal_chainStyle="packed"
      

      enter image description here

, . .

enter image description here

.

enter image description here

, () .

enter image description here

/

, . ( docs).

  • ( )
  • Weighted

enter image description here

. .

+7

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


All Articles