Questions tagged [android-relativelayout]

Android layout that displays child views in relative positions to each other or to the parent view.

RelativeLayout is a view group that displays child views in relative positions. The position of each view can be specified as relative to sibling elements (such as to the left-of or below another view) or in positions relative to the parent RelativeLayout area (such as aligned to the bottom, left or center).

RelativeLayout is a powerful utility for designing a user interface because it can eliminate nested view groups and keep your layout hierarchy flat, which improves performance. If you find yourself using several nested LinearLayout groups, you may be able to replace them with a single RelativeLayout.

This tag is to be used with more general or tags.

Useful links

3853 questions
1
vote
1 answer

Change RelativeLayout Height

I want to change te height of a Relative layout. I want to change it from 70dp to 80dp when you push on a button. I checked if the button works with visibility change and is does work. I have searched for answers see Link Changing relative layout…
matthijsW
  • 373
  • 1
  • 2
  • 11
1
vote
4 answers

Unable to center layout in android

I am trying to center the relative layout inside linear layout. But I'm unable to do it. This is my complete code :
Ruchir
  • 1,086
  • 4
  • 24
  • 48
1
vote
4 answers

How to center Linear layout

I am trying to center Linear layout contents to center. This linear layout is inside the Scroll View and Relative Layout. This is my code given below :
1
vote
1 answer

Align top imageView with the center of a relativeLayout

how could set the layout parameters of the imageView in order to get something like this? Thanks!!
Gonzalo Solera
  • 1,182
  • 12
  • 26
1
vote
1 answer

Android relative layout bottom margin not working correctly

I'm creating a dynamic layout application for the first time. I'm fetching the data from an online database and using an XML layout to present it to the user. I'm having an issue with the bottom margin. It's being covered up by another layout that…
1
vote
0 answers

Relativelayout child views surrounded to an movable anchor in center

I wanted the relativelayout child views to be adjusted w.r.t an anchor view placed in center. So basically I have four views with one corner anchored to parent edge and another to center view. I have done this in past successfully, but this time the…
Avinazz
  • 372
  • 2
  • 14
1
vote
3 answers

How is it possible to set weight 1/3 for a RelativeLayout with a minWidth ?

I think the title is enough explicit however let's explain it again. I have a RelativeLayout and a GridView that I've set weights at 1/3 for the first one and 2/3 for the second, but on some screens the RelativatLayout isn't wide enough, so my…
1
vote
6 answers

Align 2 rows of controls that align at the center using relativelayout

Android Studio 0.5.4 Hello, I have a relativeLayout with 2 columns of EditText's. I want the second row to start from the center of the screen, and the EditText's in the first column to start from the left and stop at the center. I have been…
ant2009
  • 27,094
  • 154
  • 411
  • 609
1
vote
1 answer

Components in RelativeLayout are Squeezed or shrinks in android on resize

I have 3 fragments aligned horizontally. I am using Relative layout for the last fragment. When I provide an ImageView in the last fragment/layout (RelativeLayout) it actually squeeze/shrinks the imageview . But when I use LineraLayout it does…
user3121011
  • 449
  • 3
  • 12
1
vote
3 answers

Problems adding a footer with RelativeLayout

I have an Activity with a ScrollView and I want to have a footer below it. I tried this:
KCD
  • 678
  • 5
  • 20
1
vote
3 answers

ScrollView Not working its just showing empty view

i am trying to add a Text-view in a Scroll-view and then adding this scroll view to Relative-layout programmatically but its just showing empty view even adding only text-view to Relative-layout its working. TextView aboutTextView = new…
1
vote
2 answers

positioning layout in android

I have something like to this: I want that when the relative_layout stretch to fill the screen, stretch layout_content (layout_header and layout_footer not resize). And when the screen size is smaller than layouts then scrool My code currently…
user60108
  • 3,270
  • 2
  • 27
  • 43
1
vote
1 answer

Scrollbar for an Relative Layout

I tried a lot of things to answer this question by my self, but I can't do this. So, can you help me? :) I want, that I can scroll a Layout. But when I try it, it's never the full height.
user3465614
1
vote
1 answer

android.widget.RadioButton cannot be cast to android.widget.Spinner

I am using relative layout for one of my activity, but it stops, whenever i launch this activity. The error is "android.widget.RadioButton cannot be cast to android.widget.Spinner". The xml file is as follows:
achiever202
  • 103
  • 1
  • 2
  • 8
1
vote
1 answer

Aligning the ImageView to left the text view to center and checkbox to most right in android xml

I am making a activity layout using RelativeLayout i want the image view to be in most left and textview to be in center and checkbox to be in most right but layoutgravity and gravity is not working please can somebody help