Questions tagged [layout-gravity]

Android layout parameter that sets the gravity (alignment) of a View or Layout inside its parent container.

Standard gravity constant that a child supplies to its parent. Defines how the child view should be positioned, on both the X and Y axes, within its enclosing layout.

Must be one or more (separated by |) of the allowed constant values.

146 questions
0
votes
1 answer

Why gravity doesn't center all of my views?

I was expecting all my TextView to be vertically centered in my RelativeLayout but this is only the case for the logo one. The others are anchored to the top of the latter. Image Here's my layout :
Lambda
  • 1
  • 1
0
votes
1 answer

Reparse android gravity

For testing purpose: Here, for example:
ilw
  • 2,499
  • 5
  • 30
  • 54
0
votes
1 answer

How can I move the first column on the right side without using gravity property?

At the table I tried to move the red columns from the right side to the left side with the possibility of rotation. I tried using the android:gravity="right", but it did without results. How can I move the green column to the far right side and move…
0
votes
5 answers

TextView Center Gravity not working

I have tried all the possible combinations that I can think of but I am not able to position textview correctly. Here is the screenshot of the problem From the first row of the image of the A Symbol it is clearly visible that margin from top is…
0
votes
1 answer

absolute view position gravity stay with parent of parent instead of parent

Can I set the blue view in the center of the black layout Knowing that the black layout is it's parent of parent like in the image center parent of parent
0
votes
1 answer

GravityForms - List Field with DropDown on entries column

I use GravityForms List field. I use multiple columns on this list fields. My question is : for one column, can I get a drop-down with multiples choices ? I can implement it in PHP but no idea for API to use. In fact I want just transform a textbox…
0
votes
0 answers

ViewGroup subclasses "adjusts" child views when another view is added or removed, how do I prevent this

Whenever a new view is added or removed, everything is adjusted. I can see how in majority of use-cases this is a very good thing, but unfortunately for me, it's something I need to avoid. I'm assuming that onMeasure() is called whenever a view is…
0
votes
1 answer

How do I layout two EditTexts side by side to each other in a GridLayout?

I have two EditTexts. I'd like each to take up half of the UI screen width. Below is my xml layout file. Only the leftmost EditText ("Due Date") is showing so I'm clearing missing something here. The rightmost EditText that should be showing is…
AJW
  • 1,578
  • 3
  • 36
  • 77
0
votes
4 answers

Android TableRow TextView falls out of view on right side

I have a table which is intended to display a name followed by a value. The names should appear on the left of the row and the values on the right. Here is an example: This is my XML code:
Brian
  • 7,098
  • 15
  • 56
  • 73
0
votes
1 answer

Programmatically adding TableView inside LinearLayout won't respect its gravity

I have a TableLayout defined as a layout resource which I am trying to programmatically add to a vertical LinearLayout whose gravity is "center". This is the code I use: LayoutInflater inflater = getLayoutInflater(); LinearLayout ll = (LinearLayout)…
0
votes
2 answers

how to set a customview to center of an activity in android?

I have made a customView for a .gif image support in android. I got success in that, but currently that view is aligned to the top left corner of my activity. I want it to be aligned to the center of my activity. Please tell me how can I do this. My…
0
votes
4 answers

Linear layout gravity and place item

today i'm working on layout and i have a question , basic i think. I have a linear layout and an imageview on it. I want to display the image and the left or on the right of the layout I tried , layout_gravity It's important to precise that i want…
0
votes
2 answers

Changing the orientation of Buttons in Android app

I'm designing a GUI for android game. So far I designed this this is my code
Guest
  • 53
  • 2
  • 15
0
votes
5 answers

layout_gravity of button in LinearLayout not working correctly

My requirement is to achieve this in LinearLayout. It is having only one child view. In horizontal orientation, a button needs to be at center horizontal, if layout_gravity is set. my layout xml is
Arundas K V
  • 801
  • 2
  • 14
  • 28
0
votes
3 answers

Android - Place oposite views in a Layout

I have a Horizontal Layout and I have some views inside it. I want some to start from the left and others to start in the right, but I can't manage to do it. I tried several Gravity configurations but they don't do anything. That's the case I…
Michel Feinstein
  • 13,416
  • 16
  • 91
  • 173