layout_constraintHorizontal_bias and layout_constraintVertical_bias

Viewed 1465

I started working on improving my UI, using constraintLayout. while using the layout editor i found some properties i.e layout_constraintHorizontal_bias and layout_constraintVertical_bias.

I don't really get their meaning or function, what exactly are they and their functions ?

2 Answers

Here you can find sample video that shows the usage of bias sample.

For example if you set both horizontal constraints view is centered between 2 views (has bias set to 0.5). And you can move view more to left/right side of screen by changing bias to some value from 0 to 1.

Bias

Bias is used to adjust the spacing between a view and what it is constrained to. They specifically work with centered constraint views and it can be added vertically or horizontally.

more at here

Related