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

2760 questions
1
vote
1 answer

Connecting constraint removes margin

When I'm programmatically setting a constraint, the side wherein I'll connect the view to another view seems to be losing the margin (I already have a margin set for the view): bottomLineView.setVisibility(View.VISIBLE); ConstraintSet…
1
vote
1 answer

Constraintlayout bug Android Studio

I was happily developing on Android (making some design) when I moved a button up in hierarchy and everything got weird. I'm using Constraintlayout for better alignment. As you can see, on the blue screen there's no two buttons neither…
1
vote
2 answers

ConstraintLayout beta 5 ImageView scaling issues in RecyclerView

Since I updated to com.android.support.constraint:constraint-layout:1.0.0-beta5 I'm observing strange behavior when using an ImageView that scales inside a ConstraintLayout used in an RecyclerAdapter I've made a demo project with least steps to…
1
vote
2 answers

Converting an Android ConstraintLayout back to a RelativeLayout

I have a ConstraintLayout that I would like to convert back to a RelativeLayout and then nest a ConstraintLayout within that RelativeLayout. Android Studio has a built in method of converting a RelativeLayout to a ConstraintLayout: But I don't see…
1
vote
2 answers

I got only 1 Item in list view

I am trying to use ConstraintLayout and I am making simple listview. But the problem in the list view is it is not scrolling So I tried to put scroll view as parent and I put ListView inside it but I got only 1 item.
Mithil Amin
  • 169
  • 3
  • 12
1
vote
1 answer

How to Create smaller Button in Constraint Layout

It looks like that the minimum size button available in constraint layout is 88 X 44 I am trying to create a smaller button of 42dp x 28dp, but its not creating it, if i define the size from xml, it does not change the size, and display the default…
dev90
  • 5,609
  • 11
  • 50
  • 122
1
vote
2 answers

How to convert vertical guideline into Percentage

This looks easy,After adding Vertical Guideline, When you click on the upper arrow it turns into percentage, but there is something wrong in my android studio, or in the constraint layout version i am using or may be i am doing something terribly…
1
vote
2 answers

How to create Horizontal Scroll View in Constraint Layout

I am trying to place 8 Image Views horizontally in a constraint layout, but the problem is that 2 Image Views of 200X200 occupies the whole screen horizontally, and the third image is outside the screen. When i was using normal layout, i put all of…
dev90
  • 5,609
  • 11
  • 50
  • 122
1
vote
1 answer

ConstraintLayout alignment with offset

I am using a ConstraintLayout with two views inside. An ImageView that varies in size depending on the image loaded and a View which acts as a custom made dropshadow for the Image. What I've been doing so far is adding 8dp padding to the ImageView…
JesperQv
  • 260
  • 4
  • 11
1
vote
1 answer

How to create expandable form layout on android

I'm trying to create an insert form for new students, however I need to make a set of EditText fields mandatory and if the users want to fill in more, they can click the button next to the "name". Below is also a clickable TextView that also expands…
Thomas Marques
  • 611
  • 1
  • 5
  • 15
1
vote
0 answers

Not able to see programmatic ConstraintLayout guidelines in LayoutEditor

I have extended ConstraintLayout and added a few guidelines in code. I am able to align the views based on these guidelines in xml but I am not see these guidelines in the layout editor.
1
vote
1 answer

ConstraintLayout: Minimal distance to edge with wrap content

I have e.g. a Textview in a Constraint Layout, which I want to be as small as the text is (wrap content): Here is my XML:
1
vote
0 answers

How responsive is ConstraintLayout

As I read in the documentation you should be able to build a responsive layout. Let's say we have two views : A and B If you are using the app on a tablet, A should be placed left of B. If you are using the app on a smartphone, A should be placed…
iamserious
  • 51
  • 7
1
vote
3 answers

Dynamically setting view width as a percentage of parent layout

I have a simple progress bar view that i want to dynamically change the width as a percentage of the parent layout. I see there is a set minimumWidth api. But what is the correct number to be passed in? Should I get the parent width and then just…
Zhen Liu
  • 5,662
  • 9
  • 46
  • 77
1 2 3
99
100