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.

0
votes
1answer
30 views

NestedScrollView Having Constraint Layout not scrolling

My xml is composed by one constraint layout. Inside this there are 2 buttons and 1 nested scroll view. Inside the ScrollView there are various elements including recycle view. I would like that the ...
0
votes
0answers
49 views

memory leak caused by layout

So I was looking for memory leaks on my app using LeakCanary then it report about a confusing leak. The leak was caused by the main layout of my MainActivity which a ConstraintLayout. The log shows ...
0
votes
1answer
38 views

Change height percentage based on another view's height in ConstraintLayout

I have a view defined as <View android:id="@+id/guideLayout" android:visibility="invisible" app:layout_constraintBottom_toTopOf="@+id/signupBtn" app:...
1
vote
1answer
24 views

Using FrameLayout inside ConstraintLayout

I have following ConstraintLayout: <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" ...
0
votes
2answers
90 views

Add ImageView on top of TextView (ConstraintLayout)

I didn't found any way to put an ImageView on top of TextView(s) with ConstraintLayout. It should look like on the screenshot below but if I run my app the imageview disappears. Edit: Adding android:...
2
votes
0answers
38 views
+50

Problem in using NestedScrollView in Constraint layout

I am using Constraint layout inside the NestestScrollView as shown below. <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://...
0
votes
0answers
21 views

Adding constraints in onLayout for a ConstraintLayout not working inside RecyclerView

I have a RecyclerView to list items. And each item in the RecyclerView is a subclass of ConstraintLayout. I tried to add some constraints using ConstraintSet in onLayout and the onMeasure even in ...
0
votes
1answer
31 views

How can i change the position of a TextView through Java code?

I want to change the position of A textView (in Java code, in Attribution to X and Y), After animating this view. Software : Android Studio . Layout : Constraint Layout . How can i do this?
0
votes
3answers
49 views

How to create this layout using ConstraintLayout

I have a problem with made this screen xml: Maximum height of RelativeLayout must be 50% of all screen height. And if height of body layout is more than 50%, relative layout height must decrease. I ...
1
vote
3answers
34 views

setup constraint in a ConstraintLayout properly while using Guideline

I have following ConstraintLayout : <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" ...
0
votes
0answers
43 views

ConstraintLayout: minWidth and Ellipsize problem

I have two TextViews constrained to each other. The TextView with id "list..._label" needs to behave like this -> Have a minWidth when TextView with id "list..._value" is so wide that it truncates ...
0
votes
3answers
35 views

How do I center a text inside a chain relative to the whole screen?

I want to create a user name centered TextView with an edit button to the right of the screen. If I specify the TextView to match the start/end of the parent, it will center. However, the text will ...
2
votes
0answers
41 views

onTouch() method doesn't receive ACTION_DOWN

I have an app, where I need to display multiple RecyclerViews inside ConstraintLayout inside NestedScrollView inside SwipeRefreshLayout. All RecyclerViews have LinearLayoutManager with horizontal ...
0
votes
1answer
24 views

Android ConstraintLayout performance improvements - Missing in action

I have created a custom view and inserted logging for an estimated performance comparison public class CustomInAppKeyboard extends LinearLayoutCompat { private static final String TAG ="...
0
votes
1answer
29 views

ConstrainLayout or RelativeLayout won't work with the ScrollView

I'm adding multiple views programatically to a ConstraintLayout, but the scrollview is fixed, it isn't scrolling. I tried using a RelativeLayout and it's the same. It works fine with a LinearLayout ...
0
votes
2answers
32 views

Specify ConstraintLayout's constraintDimensionRatio based on screen size

I have a layout that has an image that needs to be displayed at different aspect ratio's depending on the screens size. I tried to do it like this app:layout_constraintDimensionRatio="@dimen/...
0
votes
3answers
45 views

ConstraintLayout, Elevation of Child Views, and Backward Compatibility

I have a ConstraintLayout and one Button and an ImageView as its child views. The ImageView is placed over the Button with the expectation that the ImageView would be drawn over the Button. (...
1
vote
1answer
35 views

ConstraintLayout with RecyclerView Top and Buttom views some part are invisible.

From 2 months I'm playing with ConstrainLayout but every time I face a few problems and after spending a lot of time I find the solution but now I'm in a deathlock. My view upper part is hidden by the ...
0
votes
1answer
37 views

ConstraintLayout - Behavior of match_constraint with only one side constrained

I was doing some experimentation by constraining, for example, only the right and top side of on element, and then setting, then setting the width to match_constraint and the height to wrap_content. ...
1
vote
2answers
36 views

Recycler view does not show items list when layout_height = “match_constraint” in Constraint layout

I want to create a UI like: for which I am using a recycler view under constraint layout. But the issue is when I set layout_height="match_constraint" of recyclerView then it does not show any list ...
-1
votes
0answers
31 views

Creating rows of content using ConstraintLayout

I'm currently running into a complication with a relatively involved ConstraintLayout-based implementation of a design. The design is a row of items as seen above. These rows are static, and are ...
3
votes
2answers
80 views

Constraining dynamic sized views to bottom of a view in ConstraintLayout

I have a layout with design requirement like : The close button has to be on top, and below it are the ImageView and TextView. The TextView's size is dynamic, depending on what was saved in the ...
0
votes
3answers
46 views

Why does my ConstraintLayout chain fail to build?

According to the XML editor my layout should look like: But in the app it renders as: I don't understand why the chain feature doesn't work in cases like this. How do I fix it for this instance and ...
0
votes
1answer
43 views

How do I center a packed chain in a ConstraintLayout that contains a View with width `0dp`?

I want to center the headline of my page. The headline can look like (1) Dokument1 or (3) GreatDocument. I want to have right and left margins of 60dp and the name of the document has a variable ...
0
votes
2answers
48 views

How to add fixed width image view in center horizontal using constraint layout

Hello guys, I need to add 2 fixed width and height imageview in to center of screen using constraint layout how we can achieve something like this. xml layout <?xml version="1.0" encoding="utf-8"?...
0
votes
0answers
43 views

Android ConstraintLayout background color disappears

I have a EditText and a ImageView nested inside a ConstraintLayout. Both the EditText and the ConstraintLayout have a the same background color (to get rid of the underline in the EditText ). But ...
0
votes
1answer
25 views

What is the far most bottom part of a layout called and how do I change its color?

There is a white part at the bottom of my layout. I guess this is the parentof the layout. How do I access it and change its color so that it's not white. I don't want to change the constraints as ...
3
votes
2answers
78 views

Why ConstraintLayout slower than LinearLayout in RecyclerView item?

I'm changing the xml item of recyclyerView from LinearLayout to ConstraintLayout. When I'm scrolling the recyclerView horizontal, it lags and renders very slowly than LinearLayout. ConstraintLayout ...
0
votes
0answers
49 views

Build Failed because of duplicate value for resource 'attr/mode' with config

after I upgraded constraintLayout version from 1.1.2 -> 2.0.0-alpha2 I'm getting this error java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android ...
0
votes
0answers
31 views

Why does the view keep cutting off on the right in Constraint Layout?

As you see in the code below, I have a one-line text view on the left and a listview on the right(set to String). The paragraph keeps cutting off.The views are aligned horizontally(with each other) ...
0
votes
2answers
41 views

Creating a square based on screen width android using constraint layout

I am trying to create a view that equals fifty percent of screen width and height should be same as width in a constraint layout <android.support.v7.widget.CardView app:...
0
votes
2answers
89 views

Android circle constraint programmatically radius

I started to use the "new" constraint option from ConstraintLayout, the circle constraint. I would like to apply the value for the layout_constraintCircleRadius attribute programmatically, once I ...
0
votes
1answer
68 views

Changing visibility of element in constraint.Group

I have spent an hour trying to figure out, who is changing one of my views visibility. It turned out to be constraint.Group. Well, from the start: I have, for example, seven views, five of them (...
0
votes
1answer
33 views

Can't figure out layout dependencies in Android

I need to create a layout which should look like this: The TextView content should be wrapped so the ImageView is always at the ent of the text. TextView should not overlap with other views ...
0
votes
1answer
37 views

Problem with multiple horizontal barriers in ConstraintLayout

I'm banging my head against the barriers of ConstraintLayout (sorry for the pun...) Here's what I would like to accomplish: Place a label and an edittext in the "first row". Align their centers ...
2
votes
2answers
61 views

Collapse Constraint Layout to SmallerView

I have one layout. Now intend is when I come to this view it should give me Expanded view but when I collapse it should shrink to Smaller view What I have Tried I have tried CollapsingToolbar ...
0
votes
1answer
42 views

set TextView's gravity programmatically in constraint layout

I am programmatically change the Gravity and background of TextView in ConstrainLayout the background color change correctly but the gravity don't change how to solve this problem please if(...
0
votes
1answer
26 views

Failed linking file resources when using Motion Layout KeyPosition

I am getting "Failed linking file resources" with "error: attribute type (aka com.testapp.client:type) not found" When using the new MotionLayout, specifically when adding a KeyPosition ...
0
votes
1answer
32 views

Have an ImageView with same width and height in ConstraintLayout

How can we make ImageView width and height equal to width of parent ConstraintLayout? So it displays a full width square ImageView. Generally how can one set HEIGHT of some widget equal to WIDTH of ...
2
votes
1answer
38 views

Don't shrink imageview or background when softkeyboard is open

When keyboard is open the background is shrinked. have a look on Quote: Activity have android:windowSoftInputMode="adjustResize" And there is my layout: <android.support.constraint....
0
votes
0answers
57 views

RecycleView width and ConstraintLayout

I Have ViewPager, inside ConstraintLayout with RecycleView. If I set width concrete in dp, the sides have empty space like this: if I set match_constraint with references to sides: But I want ...
0
votes
0answers
48 views

Custom wrapping view in Android using xml layouts

I want to create a wrapper element that can be reusable throughout the whole app, because it's the base of each screen. This wrapper should be possible to add to layout editor in Android Studio and ...
-1
votes
0answers
58 views

“Three state” collapsing toolbar with Motionlayout / ConstraintLayout

I try to build simple "collapsing toolbar" layout with Motionlayout. There is image at the top of layout and recycler view below the image. When user scrolls recycler view up, image at the top is ...
0
votes
1answer
23 views

ConstraintLayout and AdMob AdView layout issue

I'm using the following layout to have my content layout on top of the adview. The adview is supposed to be positioned to the bottom of screen. The adview height is wrap_content. The top_view_layout ...
0
votes
3answers
59 views

implementing constraint layout in scrollview

scroll view not working when implementing like this <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://...
0
votes
0answers
59 views

Bring view to front on MaterialCardView and ConstraintLayout with elevation

within my layout which contains a MaterialCardView i want to add app:cardElevation="10dp". But when I apply the cardElevation my button gets messed up. I tried many suggestions from other ...
0
votes
2answers
32 views

Bias attribute is ignored

I have a simple layout of horizontally chained views with spread_inside chain style. When I try to move the views using the bias attribute to desired position I've found out that bias attribute is ...
3
votes
2answers
68 views

Constraint Layout and scrollview doesn't work

I'm trying to realize a layout for my Android application. In the designer I can see everything is fine, but when I emulate (or when I install the application on my phone) the appearance is totally ...
0
votes
3answers
57 views

ConstraintLayout how to pack keeping the same ratios of distance

I have a layout that exceeds the view boundaries after applying all the margins I'm looking for. I read that applying a chain will make it keep the same ratios while packing all the elements inside ...
0
votes
0answers
29 views

app:layout_constraint values always displayed as undefined in xml source view - Android Studio 3.2

My layout file: <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" ...