Questions tagged [android-constraintlayout]

A new type of layout available in the Android Support repository built on top of a flexible constraint system, marking views positions relative to each other.

ConstraintLayout is new type of layout that you can use in your android app. It is new powerful and flexible Android layout that allows you to express complex UI without nesting multiple layouts.

It is available since Android Studio 2.2, part of the support library and compatible from API level 9 (Android 2.3 GINGERBREAD).

ConstraintLayout aims at improving performance of layouts by reducing layout hierarchies and reduce the complexity of trying to work with RelativeLayout.

ConstraintLayout is compatible with other layout types such as RecyclerView, LinearLayout.

There are currently various types of constraints that you can use:

Relative positioning Margins Centering positioning Circular positioning Visibility behavior Dimension constraints Chains Virtual Helpers objects Optimizer

For more information about ConstraintLayout - Build a Responsive UI with ConstraintLayout

3207 questions
1
vote
1 answer

Problems with constraint layout

I´m having some problems trying to create a new layout. I´m using a ConstraintLayour with an ImageView as background and 6 buttons (A,B,C,D,E,F) that should have a fixed possition over the ImageView. While the preview in Android Studio looks like…
fromAB
  • 13
  • 5
1
vote
5 answers

Place mutliple TextViews on the front of ImageView

I'm using CardView for recycleView's item My CardView contain one ImageView and multiple TextView I want to place mutliple TextView on the front of ImageView with xml center of image view (no problem, I did it) bottom right bottom left top…
1
vote
2 answers

how can I move views on the right direction in constrainlayout

I am developing a news app and I want to move views on the right direction in constrain layout. but I could achieve what I want below my XML file where I have implemented constraint layout any suggestion and tips greatly appreciated. I am…
1
vote
3 answers

Android layout not matching with device [Android Studio]

Hi I am new to using android studio and I do not get why the layout that I am seeing in the preview of the IDE does not match with the ones that I am seeing on my screen. I am using Samsung J7 Prime. This is what I see in the preview however, this…
Amber
  • 13
  • 7
1
vote
2 answers

Change constraint in recyclerview viewholder layout - android

I am working on chat app so I want time TextView to be like whats app it's constraint can change depend on the text So I tried the view tree observer in the message layout and it somehow worked but there something missing private fun…
1
vote
1 answer

ConstraintLayout draws outside DialogFragment boundaries

I want to create a dialog with round corners using ConstraintLayout, DialogFragment and a custom background. The dialog must have a scroll area at the top and a custom button at the bottom. The dialog should resize in height based on the size of the…
1
vote
1 answer
1
vote
1 answer

Cant scroll item from include layout

Here is my problem. I have an include layout in my home page for say. I want to make it scroll because to long to put. I had add scrollview before the constraint layout of my home xml which where I include my other layout. I have search and all of…
1
vote
0 answers

TextView shows only first letter in RecyclerView

In my application, I have a RecyclerView displaying products with an image and a title. The layout use a ConstraintLayout (version 2.0.0-alpha5) and the TextView width is based on the image width. I want the title to be singleLine, so I declared…
leb1755
  • 1,386
  • 2
  • 14
  • 29
1
vote
2 answers

Is it possible to contain a button with respect to the bottom, rather than the top element?

So I am currently using constraint layout for my signup screen. However, the signup button is supposed to be like 100dp from parent bottom, rather than 200 dp from the top element. Whenever I try to remove the top margin and try to make it relative…
1
vote
1 answer

Android layout: how to better manage different screen sizes?

I work on an app that containing some error screen that basically share the same structure: a AppCompatImageView: it contains an image that represent the encountered error, this image can be in "full width" mode or not a TextView: it contains the…
1
vote
1 answer

ConstraintLayout handles not showing Android Studio

I just updated Android Studio to 3.4 after that the constraint layout handles are not showing in design view.
Jeeva
  • 3,975
  • 3
  • 23
  • 47
1
vote
3 answers

ScrollView isn't placed below ToolBar

I faced with the following problem: ScrollView in my activity should be placed below ToolBar. Here's the layout of this activity:
Sergei Mikhailovskii
  • 2,100
  • 2
  • 21
  • 43
1
vote
1 answer

ConstraintLayout: translationX animation to push right a RadioButton and an ImageView together

I'm trying to push right an ImageView using a translationX animation on a RadioButton. That's the layout that I've created:
Roses
  • 350
  • 5
  • 13
1
vote
0 answers

BottomSheet hides when outside content changes

I have a viewgroup with BottomSheetBehaviour from MaterialComponents (the sheet content is clickable, hidable) The layout included in parent (CooridnatorLayout)
1 2 3
99
100