Questions tagged [constraintlayout-guideline]
19 questions
7
votes
2 answers
ConstraintLayout set percentage to imageview width and height in RecyclerView item
When we have a recyclerView with images i want to have the image (from which i dont know the dimentions of it) to have a max width and a max height as a percentage of the screen

james04
- 1,580
- 2
- 20
- 46
2
votes
1 answer
Android Constraint Layout result differs when using guideline
The result for a Constraint Layout differs when I use a Guideline in my Constraint Layout.
Guideline:

Sebastian B
- 113
- 1
- 6
2
votes
4 answers
Equally spaced four images using constraint layout
i want to equally spaced four images using constraint layout...i have used guidelines but it is giving me a lot of space between the images and right corner images are going out of the screen
i want something like this -->
but from following code…

IRON MAN
- 191
- 3
- 18
1
vote
2 answers
ConstraintLayout stick view to wrap_content view
I tried to stick counter to nameText while counter should not exceed the container from the right side.
I want to only use the xml and no programmatically change it.
I played with the layout.xml
code example:

motis10
- 2,484
- 1
- 22
- 46
1
vote
1 answer
Dealing with Imageview & guidelines
I am creating a quizz game and struggling with constraining the image of my Imageview in the guidelines I have declared.
In Android Studio preview everything seems fine and as expected. Below is a printscreen of this expected result:
But when I run…

Julien LAFFITTE
- 21
- 6
0
votes
1 answer
how to set items when soft keyboard is shown with using guideLine in constraint layout?
I am using ConstraintLayout in my application.
When soft keyboard is shown, I want to only button move above that And other items do not move up. I did this with using a scrollView.
Now I used guideLine to support all screen sizes, but after soft…

Nima Khalili
- 360
- 4
- 20
0
votes
1 answer
How to set guidelines to the original screen size inside scrollview
I just started app development trying to make an e-commerce app since using fragments is a better way rather than activities I made a home page inside which I want to show first the action bar then top-selling (top-4 selling products) and after that…

Anmol Sethi
- 1
- 1
0
votes
1 answer
Change the background color below one guideline
As a beginner in android development, I am trying to create a layout using ConstraintLayout. I have already created a bottom guideline and want to colorize the space between this guideline and the device bottom. Here is my code:

Guilherme Hepfener
- 84
- 8
0
votes
1 answer
Android Scrollview inside constraint layout is not working. How do i fix this?
Adding a scroll view inside a constraint layout is not working. Can anyone please help me to solve this issue? Here is the layout for your reference. Even after having one child linear layout inside a Scroll view is also not working. It overlaps out…

Ganesh Kumar
- 1
- 3
0
votes
1 answer
The ImageViews in child ConstraintLayout loose its position when added to a FrameLayout in parent ConstraintLayout
Please help me find a way to combine two ConstraintLayouts so that the ImageViews are displayed correctly.
I have an activity that used to work fine for quite a few years. But after updating to androidx and updating to…

Creative_P
- 1
- 1
0
votes
2 answers
Add margin to guideline objects inside ConstraintLayout
Is this possible?
I want following:
HEADER of a defined height (e.g. 64dp)
4 rows of evenly distributed heights (25% of view height MINUS header height <= this is the problematic detail)
Can I somehow achieve this with a…

prom85
- 16,896
- 17
- 122
- 242
0
votes
1 answer
Guideline does not shift based on change in Views dimensions inside barrier in ConstraintLayout
I have my root layout as ConstraintLayout in my activity. I have added one Guideline which is Percentage based and it is about 35 % from top. The Guideline divides the Layout in 2 section (35% top & 65% bottom). In top 25% section I have 2…

Satyam Gondhale
- 1,415
- 1
- 16
- 43
0
votes
2 answers
add guidelines under a button and to its right side
I have an image view on the whole screen with a button on its right-bottom side.
Now, I don't succeed to place guildelines under the button and on its right side.
I want the button to be 4.1% "margined" from the right and 4.1% "margined" from the…

Erez git
- 73
- 8
0
votes
1 answer
Androidx Guideline can't be cast to ViewGroup
I just migrate to androidx and I got and error like this
androidx.constraintlayout.widget.Guideline cannot be cast to android.view.ViewGroup
It's working fine before I migrate my code to androidx.
I already check some solution about this casting…

foxie fox
- 35
- 6
0
votes
1 answer
How to avoid ad occupying space of view directed by ConstraintLayout guideline in aspect of other view's space directed by other guideline?
When that ad at the bottom appears, it reduces space of TextView1 but the space of green (#4CAF50) TextView2 remains the same. I want both textviews' space to be percentally the same even after the ad showing up. I mean, guidelines should lift a bit…

pbendzios
- 21
- 4