Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Chains feature of constraint layout with design in android studio

I have two images in constraint layout. I want to use chains feature with design page in android studio but I can't find icon or menu that represent Chains feature.

like image 467
saran chomphuphan Avatar asked Dec 14 '22 02:12

saran chomphuphan


1 Answers

Update (2019 august 23)

The small buttons shown on the screenshots are now available on the right click menu, Google updated the UI for more easy layout operations.

How to add Chains feature of ConstraintLayout with Android Studio's 'Layout Editor'?

The chain style can be controlled by "chain" button right below the view:

enter image description here

Click on it few times to toggle between all 3 modes:

spread (the default one)

spread_inside

packed

Let's see some examples

centering views which are connected together using chain

  1. drag and drop three buttons into the Android Studio's 'Layout Editor'

  1. Select those buttons together by dragging mouse

  1. Pack them vertically using the 'pack' button in 'Layout Editor'

  1. Align them center horizontally using 'Align-Center horizontally' button

  1. Align them center vertically using the 'Align-Center vertically' button


Here we used the pack option. similar to this, you can try spread and spread inside options of chain to see the difference. cheers :)


like image 129
Darish Avatar answered Apr 30 '23 11:04

Darish