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

Android GridView full screen

I have a GridView and I use BaseAdapter to adapt images and texts in my GridView. I have one problem, when I run my app my `GridView' has left, right, top and bottom margins. I do not need these margins. This is a my xml source:
BekaKK
  • 2,173
  • 6
  • 42
  • 80
1
vote
3 answers

android relative layout design

I want to design this layout in android, what i have tried is this.
Yawar
  • 1,924
  • 3
  • 29
  • 39
1
vote
2 answers

Android - RelativeLayout - Side-by-Side Button

I'm trying to display two buttons side by side in an RelativeLayout which is then added to a LinearLayout but the result is the two buttons on top of each other like this: Here's my code: DisplayMetrics displaymetrics = new DisplayMetrics(); …
MosesA
  • 925
  • 5
  • 27
  • 53
1
vote
1 answer

How to set button over a particular text

I have a relative layout with background image. On that image I have a text called 'GOT IT'. Is it possible to put a button exactly over that text of background? If I am putting a static position of button it is varying in different screen size. Is…
user1619306
  • 169
  • 1
  • 5
  • 12
1
vote
2 answers

Why TextViews running into each other in RelativeLayout

I have a problem with two Textviews on the same height in a RelativeLayout running into each other. I use the following Layout.
Janusz
  • 187,060
  • 113
  • 301
  • 369
1
vote
2 answers

Add border to Relative Layout at run time in Android

I want to add border from all sides to my RelativeLayout at runtime. I am able to get the border, however it is changing the background color of the layout. If I set the background color to white, it is also changing the border color to white. How…
void
  • 187
  • 1
  • 3
  • 13
1
vote
3 answers

gravity attribute on android xml not working

I just started android programming . I have been writing xml in RelativeLayout and find that gravity attribute isn't working . Every element in layout overlaps each other. I am aware that there may be better ways to do positioning but I am curious…
meShakti
  • 273
  • 1
  • 11
1
vote
2 answers

Why does using Random() to setX() and setY() Certain devices make the view disappear?

Not sure if this has been answered. I did definitley search as hard as I could, because I feel like someone else would have had this issue. Basically I am using random along with setX and setY to move a view around randomly onClick. This works…
1
vote
2 answers

Android relative layout doesn't scroll

I have a relative layout in my xml file inside which I have another relative layout which has all my content. My Inner relative layout is loaded with content that comes from my database. Also I have a edittext and button at bottom for adding…
1
vote
2 answers

Android: adapt size in RelativeLayout

I know this question has been asked a lot of time, and I've read through a lot of them but I don't seem to find an answer. I'm sorry if there is an answer out there that I've not seen. My problem is that I want to make a screen that can re-size to…
1
vote
0 answers

Slide down/Slide Up animation on changing visibility of a Relative Layout

I have a RelativeLayout in my View whose visibility is set as GONE. I need to provide a slide down translation and also set the visibility as VISIBLE for the RelativeLayout over the ListView on button press and Slide up animation on button press…
1
vote
0 answers

In Single Top mode it is not loading data into listview Android

In single top mode activity, I am successfully getting data using asynctask but I am unable to load data into ListView. Same code working in onCreateView. I am using Android Search widget. This is my onNewIntent Method: @Override protected void…
chandra mohan
  • 327
  • 1
  • 4
  • 19
1
vote
0 answers

Having a TableRow take whatever height is left in an Android TableLayout

I'm porting a board game from Windows Phone to Android and struggle a lot with the Android layout system. This is the layout of the main page on Windows Phone: I have a Grid with row definitions like this:
1
vote
3 answers

Android : how to achieve view like this, Image view over two relative layout

Android : how to achieve view like this, Image view over two relative layout Hello friends i want imageview over two layout. you can see in header. there is one imageview between two layout. i need same view. but i cannot do this. please…
Sandy Angel
  • 157
  • 1
  • 1
  • 14