Relative Layout and a Button to the left of a TextView - Squishing problem

In a RelativeLayout I have a Button to the right of a TextView. The problem is that the text view gets squished to the left of the screen. I want the Button to be squished to the right and the TextView take up all the remaining space. I can't use 'Fill Layout' on the TextView because the button then gets removed from the View completely.

How do I do this?

Asked by: Paul129 | Posted: 20-01-2022

Answer 1

Give your TextView android:layout_weight="1".

Answered by: Hailey477 | Posted: 21-02-2022

Similar questions

java - Stop GUI squishing up when keyboard appears?

I just want my GUI elements to stay where they are. Instead, whenever the keyboard comes up, they push half the labels and buttons up. I'm using relative layout if it helps. I've tried adding things like: android:windowSoftInputMode="adjustPan" to the manifest.xml but it hasn't done anything. Ideas??

Why does Android insist on squishing my Button?

I have a nice, pretty, facebook button image: But my Android layout keeps squishing it: Could anyone please help, here is a look at my layout file: <?xml version="1.0" encoding="utf-8"?> <RelativeLay...

How to stop an image from squishing into an imageview in android

Firstly I'm not sure if I've phrased the question correctly, but with some explaining hopefully i'd be able to get you to see what i'm trying to ask. I've got an image view that sits at about 15% on the top half of the screen, lets say for example the height of the image view is 30px, however the image I put in that imageview has a height of 100px. Currently all 100px of the image is squishing into the 30px.

Still can't find your answer? Check out these communities...

Android Google Support | Android Community | Android Community (Facebook) | Android