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

"Binary XML file line #8: You must supply a layout_width attribute" Although Attributes Already Exist

I'm getting an error stating "Binary XML file line #8: You must supply a layout_width attribute." However I already have a layout width specified (fill_parent) so I'm really not sure why this is happening. I'm sure it is something simple I've…
user3009687
  • 369
  • 2
  • 7
  • 17
1
vote
0 answers

How to create RelativeLayout with aspect ratio?

I'm trying to create a ListView that will fit it self to Tablet screens as well. I'm using the SwipeListView implementation so each ListView item is a RelativeLayout. So I want to create a ListView item that will keep the aspect ratio from the…
Emil Adz
  • 40,709
  • 36
  • 140
  • 187
1
vote
1 answer

Programmatically set layout_toLeftOf and layout_below for TextView

I'm creating an arbitrary number of TextViews contained within a RelativeLayout. How do I place the TextViews below or next to each other programmatically? I'm guessing I should use layout_toLeftOf and layout_below, but how? I know I can use…
abc32112
  • 2,457
  • 9
  • 37
  • 53
1
vote
2 answers

Scroll middle content with ListView in Android Layout

I'm developing android app as per the following design. I want to set the height of the scroll view to the remaining screen size (after occupied by header,footer and other texts) although there are no any contents in the list view. When the items…
1
vote
2 answers

Problems buidling grid like ui with RelativeLayout

I want a responsive home screen like this: The pictures have been drawn using MS Paint Each menu item (image + label) has been implemented as a compound view (LinearLayout containing ImageView and TextView)...the layout file of the compound view…
Shuaib
  • 779
  • 2
  • 13
  • 47
1
vote
1 answer

edit layout of existing child in RelativeLayout

I have a RelativeLayout with a number of children. The RelativeLayout is the main layout of my activity. I need to add to one of the children the layout value layout_alignParentBottom="true". I need to do this programmatically. the link How to set…
Cote Mounyo
  • 13,817
  • 23
  • 66
  • 87
1
vote
0 answers

RelativeLayout force overlap

I am having an issue getting a component on my RelativeLayout to appear as I would like. I am looking to create a static layout, that stays in place, in front of a ScrollView. The effect I am looking for is similar to the 'One Today' App (the…
Booger
  • 18,579
  • 7
  • 55
  • 72
1
vote
1 answer

ImageView changes position after loading the picture

I got the problem with ImageView position after I load picture. On the beginning when I lunch the application I have sample picture in ImageView, then after choosing another one from gallery, the old one is replacing by new and unluckily the…
MyWay
  • 1,011
  • 2
  • 14
  • 35
1
vote
3 answers

Android: how to use an xml view to insert a vertical line with "fill_parent" height - Only working with fixed size

So here is my code where I have to manually insert the height of the line which I do NOT want to do.. I want my other content size to determine the height of my listview item and I want my vertical line to simply fill top to bottom. Currently it…
1
vote
3 answers

Show Multiple ImageViews Dynamically in Relative Layout Android

I am working in An Android App in which Relative layout is
Noaman Akram
  • 3,680
  • 4
  • 20
  • 37
1
vote
0 answers

Integrating Admob to the Top/ Bottom of the Layout XML

Am trying to integrate the Admob unit into either the Top or Bottom of the layout but as soon as I put in my Admob code the apk generated will fail miserably when I run it. Could anyone please lend me a hand? Thanks Admob Code …
Fire
  • 93
  • 1
  • 3
  • 10
1
vote
2 answers

Can't set a background attribute twice (image+colour) in Java-Android

I've already posted a related question but was partially solved, so here I'll show you the whole code. The problem is that I can't set a background from a RelativeLayout in white, for example, and set simultaneously, by java code, a background…
1
vote
4 answers

RelativeLayout layout_below issue in android

I am having an issue with getting my date TextView to be below my unit TextView when the activity name is too long in the rows for my ListView. Here is my row layout code for my listview:
nommer
  • 2,730
  • 3
  • 29
  • 44
1
vote
1 answer

Missing Views inside a Custom RelativeLayout

I got a problem with an modified android layout. After I extends the normal relative layout so that it will be automatically square sized, all embedded other views will disappear.
unexpectedUser
  • 63
  • 1
  • 1
  • 7
1
vote
2 answers

TextView position in a RelativeLayout with background image

Good morning, I try to explain my scenario: there is an Activity with a background image representing a person who is speaking. I have to place my TextView exactly over the callout, so it seems that the person is speaking. Below of the TextView I…
Nicola
  • 11
  • 1
1 2 3
99
100