Questions tagged [constraint-layout-chains]
67 questions
1
vote
1 answer
Is it possible to control the bias of both sides of a chain in Androids ConstraintLayout?
I created two rows of ImageButtons through chains and used the packed style to close the gap between the two rows. However there is a lot of extra space surrounding the overall ImageButtons rows on the top and bottom.
When I try to use…
user4332856
1
vote
1 answer
Use ConstraintLayout for responsive views
I want to use Constraint Layout to design a layout with automatically wraps in smaller displays, without using code behind, see attached example image, please:
It's something like web grid systems, like Bootstrap or Flex

AVEbrahimi
- 17,993
- 23
- 107
- 210
1
vote
1 answer
Constraint Layout hide View with chain weight
Hy,
I want to have 2 Views equally spread the screen width in a ConstraintLayout.
Used chains and weight to achieve that.
0
votes
1 answer
How can I layout two TextViews horizontally so that they meet in the middle but only use as much space as is needed
I'm trying to create a layout containing two horizontally aligned text fields with a preceding image icon for each. One of these fields is left aligned, and the other is right aligned, like this:
|[*]Some text [*]Some text]|
When the text…

AndrewR
- 10,759
- 10
- 45
- 56
0
votes
1 answer
set proper constraint in bottom android
Hey I am working on constraint layout in android. I am trying to fit my text view and image view in same row, and my image is bigger in size.
.
The problem is I want to give proper constraint. After setting the proper constraint it will look like…

Kotlin Learner
- 3,995
- 6
- 47
- 127
0
votes
1 answer
ConstraintLayout with chain makes the view jump
Update: Adding screenshot of desired result
I've this simple layout:

Sharas
- 1,985
- 3
- 20
- 43
0
votes
1 answer
Android ConstraintLayout vertical chain weighted spaces
The idea is to have vertical chain with different spaces between items. To be more clear, here is an example of desired behaviour for LinearLayout.

Denis Vodolazskiy
- 183
- 10
0
votes
1 answer
Constraint Flow widget ignores max width attributes
I have multiple layouts that I want to display in a different location depending on screen size. If the screen is wide enough (tablet), I want the layouts to display horizontally then wrap down to the next row. If the screen is narrow (phone), I…

Lee
- 13
- 1
- 3
0
votes
2 answers
Android Constraint Layout chain with fixed height view and other to fill space
I am attempting to have a chat window that has the chat messages at the top (TextView) with a chat selector/input box (Spinner/EditText) below. My goal is for the spinner/editText to be 30dp tall. I want the TextView to fill the remaining space. …

KisnardOnline
- 653
- 4
- 16
- 42
0
votes
1 answer
Modifying ConstraintSet chains programmatically not working as expected
For some reason, when modifying a ConstraintLayout's ConstraintSet programmatically to change a view position (that belongs to a chain), the result is not as expected.
In the following example I built a Button With Icon View, where the image can be…

Augusto Carmo
- 4,386
- 2
- 28
- 61
0
votes
1 answer
Android: two single-line TextView's side by side - squeeze and/or crop of either
Use case: two single-line TextViews put horizontally side by side where one of them is set to fill the rest of the available width and the other wraps its contents. In the specific use case, the left TextView expands to fill the available…

Ivan Caravanio
- 597
- 1
- 7
- 20
0
votes
2 answers
Chained sections in ConstrainedLayout
I want to have a layout with a few "sections", each section containing heading and some TextViews, EdiTexts, etc.
I want the sections evenly distributed on the screen, and they can't overlap. So it seems chain is the way to go.
But the problem I…

Pitel
- 5,334
- 7
- 45
- 72
0
votes
1 answer
three horizontal buttons with a small margin between them with ConstraintLayout
I want to draw a keyboard with big buttons for a calc app, three per row, and between these three buttons I need to put a small empty margin. I know how to do that with a LinearLayout but I completly ignore how this can be achieved with Constraint…

Drocchio
- 383
- 4
- 21
0
votes
2 answers
How to align view using ConstraintLayout that support all different size screens?
I'm using ConstraintLayout to design my screen.
Here is my code that i have tried so far

Goku
- 9,102
- 8
- 50
- 81
0
votes
1 answer
ConstraintLayout by Code - Set Constraint too soon
Good day,
I need to show a list of fidelity cards, one on the others with a small border margin, and while clicking on it, it reveal it completely while sliding.
In a fragment, I use a ConstraintLayout somewhere in the screen that I populate by…

Tweety B
- 65
- 6