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

center children in a custom RelativeLayout

I have defined a custom relative layout to force a square view in my layout. But I am having trouble centering the children in that relative layout. My custom RelativeLayout is defined as follows: public class SquareView extends RelativeLayout { …
1
vote
2 answers

How add LinearLayout and RelativeLayout programmatically in a ScrollView?

How I can add LinearLayout and RelativeLayout programmatically in a ScrollView :
A.A
  • 1,138
  • 1
  • 16
  • 29
1
vote
1 answer

ImageView with LayoutParams match_parent doesn't match parent when parent size changes at runtime

I have an imageview that I want to fill it's parent RelativeLayout to act as a background image. The image is the correct size until the other views in the relative layout expand, and thus expand the size of the entire layout (just height in my…
Chuck Pinkert
  • 1,325
  • 1
  • 14
  • 24
1
vote
1 answer

Relative Layout messed up on Android 4.4.4

I have a relatively simple relative layout with some buttons that gets messed up only on Android 4.4.4. Any ideas? I ensured that the target sdk is set to 20, and tested it against API 19. Can't think of anything that could cause this. This is the…
Maged Shalaby
  • 73
  • 1
  • 1
  • 6
1
vote
2 answers
1
vote
0 answers

Merge view corner with its parent's corner

I have created a dynamic view by extending Relative layout with corner of some radius which changes dynamically depend on device screen resolution. To this view, am adding image view to top right corner. But both corner's are mismatching which does…
Aswin
  • 1,154
  • 1
  • 11
  • 29
1
vote
2 answers

Create new RelativeLayout above existing TextView

I have an issue with the creation of a new RelativeLayout above an already existing TextView in my app. My main layout is called contentLayout and inside it I have a TextView called addRoomButton : RelativeLayout contentLayout = (RelativeLayout)…
jbltx
  • 1,255
  • 2
  • 19
  • 34
1
vote
7 answers

Button is not displaying in layout in Android

I have made an Android activity. In this activity I have a ListView and a Button. I want to add the Button to the bottom of screen. I have tried so long but it's hidden from tabbar. My xml code is as below. Please help me. code
1
vote
3 answers

Relativelayout - how to use nested RelaitveLayout-blocks

I am trying to switch my app-layout from a LinearLayout to RelativeLayout. For me its important to keep a good code-structure andI I consider it more readable if I have a parent RelativeLayyout for the whole screen and then have nested Relative…
user3155478
  • 975
  • 1
  • 10
  • 16
1
vote
1 answer

Button completely disappears when placed below gridview despite numerous configurations

I have a view in which i'd like a button to be placed below a grid view and fill up the remaining space. The view is a relative layout, and no matter what attributes I give it, if I some how relate the button to the grid view, it disappears. It only…
1
vote
1 answer

ScrollView not working in RelativeLayout

Im trying to create a application , which is just a simple list with text, buttons etc... But the list is too large and it doesn't fit on a mobile screen. So I tried to make a ScrollView, but it doesn't work. EDIT: Scrolling doesn't work on the…
1
vote
2 answers

How to have a scalable width based on the screen width for a view in android Relative Layout

In the Layout for an activity of my Android app, I need to have a line with a text aligned on the right side of it like below: And this is my XML so far:
Saba Jamalian
  • 750
  • 2
  • 10
  • 24
1
vote
1 answer

ImageView which overflows its parent

I have a RelativeLayout which I expand (vertically) when clicked on. This RelativeLayout have a background image. This is implemented by adding a ImageView to the RelativeLayout. I want the Image (and ImageView) to be larger than the RelativeLayout,…
1
vote
0 answers

How to make child TextViews stay in position in Relative Layout?

Here I have a RelativeLayout with TextViews, Spinners ect. The TextViews change according to the progress value of the respective Spinner. I want my TextViews to remain in the current position and not shift the match the length of the growing…
1
vote
0 answers

Trying to programatically create multiple relative layouts within a ViewFlipper

I am trying to programatically create a multiple RelativeLayouts inside a ViewFlipper. I'm doing this in order to build a dynamic ViewFlipper that holds N number of images, N changes. I am trying to create something like that: (that works…
Eibi
  • 402
  • 4
  • 17