3,248 questions
1
vote
1
answer
62
views
ConstraintLayout v 2.2.1 not filling screen
Yet another SO question about ConstraintLayout and positioning. I have been having trouble with a particular layout, so I decided to go back to the basics and see what I'm not understanding.
Copied ...
2
votes
1
answer
68
views
ListView inside ConstraintLayout gets pushed offscreen by other elements positioned above it
Even though ConstraintLayout in Android is not new, I have only begun to convert my older layouts over as I find time or when creating new layouts, so my experience with them is limited. They don't ...
2
votes
1
answer
66
views
ConstraintLayout.Guidelines losing proportional percentage values at runtime
I'm using a ConstraintLayout and 2 vertical Guidelines to simulate a grid-like area within my Android activity. These Guidelines represent 'columns' inside the ConstraintLayout.
I've also put 3 ...
0
votes
0
answers
16
views
How to collapse background image in CollapsingToolbarLayout and keep user info pinned and centered at top?
I'm building a layout using CoordinatorLayout with AppBarLayout and CollapsingToolbarLayout in Android. My goal is:
Collapse the Earth background image on scroll.
Keep the user info layout (...
1
vote
1
answer
22
views
Cannot dynamically adjust z-index of ConstraintLayout children when using a camera stream & map
In my layout i display a stream widget (the WidgetFPV one) which contains a surface onto which a camera stream is projected via DJI'S MSDK5 sdk. I also have a card mapCard which hosts a MapBox map ...
0
votes
0
answers
44
views
ConstraintLayout Flow is not wrapping views as expected
I'm maintaining legacy app which is still using XMLs and oldschool Views.
I have androidx.constraintlayout.helper.widget.Flow component which has constraint_reference ids to other Views.
Those other ...
0
votes
0
answers
22
views
Spacing in ContraintLayout
I m building Android Application, so this is my Activity xml file:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:...
0
votes
0
answers
16
views
Android: Multiple views occupying same location in layout - how?
I have a layout in which three checkboxes are all located at the same position. Only one of the checkboxes is enabled and visible at a time, depending on other parameters. I'm getting a "cb_xxx ...
0
votes
1
answer
71
views
Why Android Studio is complaining about this
I was following this document to find out how can use the decoupling api ConstraintLayout in Compose but unfortunately failed to build and run Here's the error I got
I can't figure out why it's ...
0
votes
0
answers
48
views
Why textview is not appearing on Gif when using Glide?
I have an ImageView, and below it, there is a TextView. Both are inside a ConstraintLayout.
The ImageView can display either a GIF or a normal image.
The TextView appears fine when I use a normal ...
0
votes
1
answer
115
views
How can I have a ConstraintLayout Flow widget wrap the "containing" views and the views also take up the remaining space?
I'm trying to use a Flow widget to replace a vertical orientation LinearLayout that I was just using inside of my ConstraintLayout. It needs to satisfy all of the following:
The "containing"...
0
votes
1
answer
47
views
How to add an ad view in ConstraintLayout at bottom and below other stuff programmatically?
This question may look similar to the following question, but I need help solving my use case. It provides explanations for adding constraints inside the XML file.
I'm trying to migrate from ...
2
votes
1
answer
366
views
Compose ConstraintLayout does not respect constraints
I'm trying to use constraint layouts to lay down my elements, but they do not truly respect the constraint I gave to them when the content of this elements is bigger than the space available.
Is this ...
0
votes
1
answer
81
views
Constraint layout Y position not matching the margin value
I'm facing some sort of trouble setting constraint on a view on runtime with a margin.
These are the y and margin coordinate when the view is displayed to the user
I set the margin like that :
...
0
votes
1
answer
50
views
Android: Two views on opposite side without overlap taking as little space as their content
I have a very simple yet frustrating issue:
I have two views inside a layout. The layout can be any layout but I have been trying to use a ConstraintLayout.
I want these two views on opposite sides ...
0
votes
2
answers
346
views
Android: How to set Max Width to match parent's width with layout_width="wrap_content"?
The width of the TextView below needs to match it's content width (in a ConstraintLayout), however when the content includes a long text, it currently extends horizontally beyond the width of the ...
1
vote
0
answers
30
views
Why the view go outside of screen by ConstrainLayout in the condition of RTL?
Problem
Here is my layout file:
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://...
1
vote
0
answers
73
views
Android - NavController - Reopening fragment is maintaining the Accessibility focus
I've two fragments -
IntroFragment
DetailFragment
Intro layout -
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&...
1
vote
0
answers
116
views
Ludo Game in Android Studio - Pawn Movement Issues on Different Devices
I am currently developing a Ludo game in Android Studio and have run into a significant issue regarding the movement of pawns across different devices.
Project Setup:
I have created a grid using ...
0
votes
1
answer
60
views
Cannot display an image in Constraint Layout
I have this xml but the image is only shown when I hard the width and height of the image. I am not sure why the constraints as I provided in the code are not working.
<merge
xmlns:android=&...
2
votes
1
answer
779
views
How to use bias in Jetpack Compose ConstraintLayout
For example, I want the right side to align with the Image's start when the Text width is less than the screen's width, and the Text will wrap automatically when the Text's width exceeds the screen's ...
1
vote
1
answer
73
views
ConstraintLayout Custom view refusing to be used as a contraint
I've created some custom views based on ContraintLayout, which is basically a pairing of a textview and some other component.
EditTextCompat and SwitchCompat.
Both of them are basically created the ...
1
vote
0
answers
33
views
Android ConstraintLayout - adjust width of Childs
I need to have a composition which dynamically adjusts child view width depending on available space.
Rules:
Right and Left dividers always visible
Dividers size: min 6dp, max 16dp
Dividers can ...
0
votes
1
answer
57
views
How to limit ScrollView content inside CardView in ConstraintLayout on Kotlin. In Runtime the content show out of bounds
I am having trouble with the content of a ScrollView inside a CardView in ConstraintLayout. In the Design view it shows as I need it but on runtime the content of the ScrollView is shown covering the ...
0
votes
2
answers
58
views
Compose ConstraintLayout's pivots aren't working as intended?
I am trying to use Compose's ConstraintLayout composable to place a composable on 30% midway through the screen from the top.
I tried using the pivotY attribute in the constraint DSL to no avail, ...
0
votes
1
answer
51
views
Cardviews not scrollable inside scrollview
In the beginning, I searched for a solution to the problem extensively but couldn't resolve it, even after trying all the solutions and answers to similar questions here.
I have a scrollview which ...
0
votes
0
answers
38
views
How do I implement the UI as in the image below using constraint layout with XML in android studio?
how do I implement the below UI using constraint layout with xml in android studio?
2
votes
2
answers
429
views
Convert XML Constraint Layout to Jetpack Compose - Chain Style, Bias
I am trying to create a specific layout with two views: a TextView and an ImageView. The TextView is dynamic, meaning the length of the text can vary. If the length of the text is less than the width ...
1
vote
1
answer
152
views
Constraint Layout items overlapping: Smart wrap text does not work when two opposing items intertwine
I want to make a list item which contains two texts , one anchored to the start of parent and one to the end of parent, I want the space to be dynamically handled each time and if too long it should ...
0
votes
0
answers
34
views
How do I bring the MedicineDetails card below nameRow (Box) using constraint layout?
This is how my preview looks without the MedicineDetails card
I want MedicineDetails card to be aligned below Add Medicine Box. I used constraint layout to do this.
But MedicineDetails card is coming ...
0
votes
2
answers
42
views
How prevent RecyclerView from overwriting the view beneath it?
This is my layout:
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto&...
0
votes
1
answer
40
views
Is ConstraintLayout broken?
This is my Activity layout:
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android....
1
vote
1
answer
37
views
Ellipsize not working with side by side text view in XML
mock
Trying to build something like this in a Constraint layout. Both textviews are side by side that are too long and should be ellipsized. Setting the layout_width to 0dp would stretch out the ...
0
votes
1
answer
161
views
Android UpdateLayoutParams match_constraint not matching new given constraints
I have a task that I'm attempting to accomplish: to change constraints and update the layout programmatically when font scale configuration changes. Here I have the following code on a recyclerview ...
0
votes
1
answer
41
views
Can't align image view to the left edge
I want to align the lower views to the left edge of the top view
enter the image description here
but they go away like this:
enter image description here
<?xml version="1.0" encoding=&...
0
votes
1
answer
38
views
How can I get the images to scale with different screen sizes in Android Studio?
In my code my app runs fine, but I am running into issues when I am using a different screen size. The buttons line up correctly but the images do not scale at all.
This is my XML file
<?xml ...
0
votes
1
answer
97
views
Foreground overlapping in constraintlayout
I have two constraintlayouts nested in another constraintlayout. I've set a foreground image for the parent constraintlayout but the image overlaps on the other two layouts as you can see in the image
...
1
vote
1
answer
42
views
Setting the constraintSet at runtime isn't aligning correctly against the parent's end
I have the following code snippet in xml. Its just showing 3 different views. But at runtime I want to change the alignment. However, the textviewShopNow should align at the parent End. But there ...
0
votes
1
answer
57
views
Understanding the Impact of Including ConstraintLayout Dependency in Android Projects
I'm using constraintlayout to design my activity:
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://...
1
vote
7
answers
333
views
Aligning a textview after a textview it was aligned to visibility is gone
When the coupon which is the small icon is gone, this part in the layout
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/imageViewCoupon"
android:layout_width="...
1
vote
2
answers
156
views
How to center the child view but keep aspect ratio in ConstraintLayout
I am using ConstraintLayout that contains child view.
I want this child view centered but keeping aspect ratio.
Layout (landscape) variant:
<?xml version="1.0" encoding="utf-8"?&...
1
vote
0
answers
163
views
Scrollable ComposeView in XML ConstraintLayout: scroll position jumping on state change
I have a ComposeView that is constrained to another View in an XML ConstraintLayout. The ComposeView houses a Column with VerticalScroll. Whenever you are scrolled to the bottom of the column and ...
1
vote
1
answer
44
views
Constraint layout making dependent view gone the UI is distorted
I have the below UI which is fine till the Live image is visible
Below is the XML layout
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/...
0
votes
1
answer
98
views
Is there a way to remove the space between the top of the screen and top of the image in ScrollView?
I wanted to display my super-tall image, so I tried to put it into ScrollView,and constraint it to the top of the screen so it would be possible to scroll through it. I imagined it would fill in the ...
0
votes
1
answer
46
views
ConstraintLayout not expanding
So this is a bit difficult to describe please bear with me.
I have a fragment with a ScrollView and a ConstraintLayout inside.
The idea is that the fragment should be filled with a survey so there are ...
0
votes
1
answer
52
views
Adding new TextViews to ConstraintLayout doesn't work onCreate but works afterwards
I'm making a dynamic grid of colored TextViews as to make tiles, since it's dynamic, so I want the gridSize to be able to be changed while it's running, I need to do it programmatically.
The problem ...
0
votes
1
answer
76
views
Android Constraint Layout by orientation
I am trying to build a layout with constraint layout that has 2 views. In the portrait view, I want the veiws to be vertically stacked and in the landscape view I want the views to be next to each ...
0
votes
1
answer
93
views
Positioning an Overlaying or floating View Above another view in Layout
In an Android application, I have a layout containing a TextView at the top and two elements beneath it: an icon and another TextView. The second TextView displays a numerical value that undergoes a ...
1
vote
2
answers
82
views
ConstraintLayout: view in vertical chain should wrap content up to 1/3 of the space
I have two RecyclerViews view_a and view_b vertically on top of each other within a ConstraintLayout.
Width: easy, match_parent. My problem is the height.
The bottom view_b should wrap its content, ...
1
vote
0
answers
59
views
LazColumn not scrolling to the bottom of the items list with Compose content into chained element into ConstraintLayout
I'm sorry for the long title, but it's a little difficult to explain.
I have a LazyColumn Composable into a FragmentContainerView. This container at the same time into a ConstraintLayout, sharing the ...