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
5 answers

Android RelativeLayout align_below not enforced when aligning on TextView?

I'm finding issues with keeping elements in a RelativeLayout in their proper order. I'm trying to achieve the following element placement: Date Value Description See the screenshot below for a better idea of what…
André Fernandes
  • 2,335
  • 3
  • 25
  • 33
1
vote
2 answers

Android : How to simplify my layout?

I am trying to create this interface : But today my result is : As you can see, i have some problems in my layout : I would like to have a fix height for each item There is some white space.. Here is the code of my grid_single.xml :
1
vote
2 answers

android:layout_alignParentEnd doesn't work on API 14

This is the relative layout part of my layout:
Lendl Leyba
  • 2,287
  • 3
  • 34
  • 49
1
vote
1 answer

android:layout_alignBottom not properly aligning button where expected

I have a couple of views that I'm trying to center over each other but at the same position at the top of the view. pw_futuretabata is a progresswheel that I want to be as big as the screen width and aligned to the top of the screen. Inside the…
ryang
  • 93
  • 1
  • 6
1
vote
1 answer

How to center relative layout with its text and images?

I have RelativeLayout which has other elements such as imageview, textview inside it. When i run the app with small screen size (Galaxy S2) it is displayed as image 1. But when it runs on a larger screen (Nexus 7) it is displayed as in image 2. I do…
Umit Kaya
  • 5,771
  • 3
  • 38
  • 52
1
vote
1 answer

Overlay for RelativeLayout inside ListView with match_parent

I am dealing with a weird problem. I am using the following layout for ListView rows:
user3264740
  • 231
  • 1
  • 2
  • 13
1
vote
2 answers

Center a group of views horizontally

I want to have some views disposed like in the following image: and God knows I have tried several ways to achieve it, none of them really working. In this last attempt, the layout looks as it should be, but I just found out that the padding…
AlvaroSantisteban
  • 5,256
  • 4
  • 41
  • 62
1
vote
2 answers

split relative layout into two equal parts using linear layouts

I have a relative layout which contains two linear layouts. I want these two linear layouts to be placed in either halves of the relative layout containing them i.e. one to be positioned at top half and other at bottom half. Can anyone here help me…
1
vote
5 answers

ImageView not center aligning

I'm trying to vertically center align ImageView in RelativeLayout but unable to do so. It seems a simple thing but I'm unable to sort out the problem. Here is the xml I defined.
Ammar
  • 1,811
  • 5
  • 26
  • 60
1
vote
3 answers

RelativeLayout: why do not my buttons show below the line?

In my RelativeLayout I am trying to put two buttons in the second half of the screen, below a line, which I create using a View. But the buttons will not show below the line (view1) This is my my XML:
Lisa Anne
  • 4,482
  • 17
  • 83
  • 157
1
vote
1 answer

Improper alignment of buttons in RelativeLayout

I used several RelativeLayouts within one LinearLayout. And the RelativeLayout used for buttons caused improper appearance as seen below: This is my .xml:
Umit Kaya
  • 5,771
  • 3
  • 38
  • 52
1
vote
1 answer

android - aligning siblings of different relative layouts

I was wondering if it's possible to align 2 siblings of different relative layouts with each other. for instance, given this XML: .. ..
orenk86
  • 720
  • 9
  • 24
1
vote
2 answers

In ListView item, RelativeLayout child not expanding to fill free space

inside ListView item what I'm trying to do is to place an ImageView over a TextView while the TextView must fill it's parent, here's what i did:
1
vote
2 answers

How to set proper position of text inside TextView which is in RelativeLayout?

I have RelativeLayout and inside of it, I have two TextViews. This is my current xml code fore that RelativeLayout:
Draško
  • 2,119
  • 4
  • 41
  • 73
1
vote
1 answer

RelativeLayout, setting width of TextView

I have a ListView and each row is a RelativeLayout with 2 TextViews side-by-side (call them textViewLeft and textViewRight). The textViewRight text can change between "xxxxxxx" and "yyy" (both different lengths). I want to set the textViewRight…
Wise Shepherd
  • 2,228
  • 4
  • 31
  • 43