Questions tagged [constraint-layout-chains]

62 questions
5
votes
1 answer

View is pushed out of its constraints in ConstraintLayout

I have a ConstraintLayout with an ImageView and 3 chained TextViews with a spread_inside chain style:
4
votes
1 answer

Create vertical chain from multiple horizontal chains with flat view hierarchy ConstraintLayout

I'm trying to take multiple horizontally-chained Buttons and TextViews and chain them vertically as sets of views, but still maintain a flat view hierarchy. Here is my initial layout and code:
David
  • 812
  • 1
  • 10
  • 26
4
votes
1 answer

Android constraint layout divide in horizontal

I'm working with an Android project and I used ConstraintLayout. I want to design the layout as two blocks which stay in horizontal line. Each block will get 50% of the width: How can I do this with ConstraintLayout?
4
votes
2 answers

ConstraintLayout weighted chains programmatically

If I try to create weighted chains in a ConstraintLayout programmatically then no views are shown. Creating them in a layout xml file works fine. I tried to set width of views to MATCH_CONSTRAINT, but then they disappear. Also setting a horizontal…
4
votes
2 answers

View disappears when padding is added in constraint layout android

I'm trying to create a vertical chain of four circles using ConstraintLayout. It renders well until I add padding to the ConstraintLayout at which point, the entire view goes missing. Contents of my layout file is as follows
4
votes
1 answer

ConstraintLayout beta5 wrap_content doesn't properly wrap

I have a XML layout for a ViewHolder inside a RecyclerView. This layout's root is a ConstraintLayout whose height is set to wrap_content. Inside this flat hierarchy there are 3 textviews and an image view with a fixed height; think of:…
4
votes
2 answers

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.
3
votes
2 answers

Chain two barriers in ConstraintLayout

I'm going to achieve this goal using ConstraintLayout: The length of each TextView is not fixed and may change and the TextViews should be in the middle of their columns. I guessed that barriers and guidelines could help me if I chain barrier_left…
3
votes
2 answers

Set a max spacing between two views using Android's ConstraintLayout

I would like to know if there is any way to, in Android, using ConstraintLayout, to set a max spacing between two views when using Chains. I know that using the margin attributes works like a minimum spacing between two views, but I could not figure…
3
votes
3 answers

Constraint Layout behaviour to match Linear layout behaviour

I wondered how to achive the same behaviour from Constraint Layout, it is easily doable with Linear layout, as you can see I have three views in a vertical linear layout , if I change visibility of midle one (textview2) to GONE , textView3 will…
bastami82
  • 3,979
  • 5
  • 28
  • 38
3
votes
3 answers
3
votes
1 answer

Scaling vector graphics in ConstraintLayout

This is a "how-to" question. I have an android activity with 6 ImageView objects in a ConstraintLayout. I would like them placed in a horizontal row, always using the full width of the screen. For larger screens, instead of blank spaces between…
3
votes
1 answer

ConstraintLayout within scrollview

I am looking to build a UI where I would like to show the scroll on landscape orientation and keep the button to the very bottom of the screen and stick to the footer but there should be fair gap between to scroll during landscape view. Any help is…
2
votes
2 answers

How many views can be chained(add relationship) inside ConstraintLayout

Constraint layout in Android supports view chaining (https://developer.android.com/reference/android/support/constraint/ConstraintLayout#chain-style) I checked several examples, everywhere only 3 views are showcased to demonstrate the concept. Is 3…
Vamsi
  • 5,123
  • 6
  • 27
  • 32
2
votes
1 answer

Chained view displaced in ConstraintLayout

I've encountered a problem with ConstraintLayout while simply placing 2 views in the center of screen. Like Title and Content bellow. Both should be centered vertically. So my layout looks like: