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
1
vote
1 answer

Gravity.RIGHT does not work when anyDensity=false

I am developing an Android app running on Xperia Z and Xperia tablet Z. My problem is that Gravity.RIGHT property is taking effect when anyDensity=true in the AndroidManifest, but it does not work when anyDensity=false. Some rightmost characters…
dai-chan
  • 11
  • 1
1
vote
1 answer

Button breaks LinearLayout layout_gravity top

I may be being an idiot, but it seems like adding a Button to a horizontal LinearLayout breaks layout_gravity="top"
Timmmm
  • 88,195
  • 71
  • 364
  • 509
0
votes
0 answers

how to add inpute transaction_id to searching gravityview

I want add A field to searching gravityview that search transaction_id for list of forms that create by [gravityview id]. but widget search to geavityview not recognised transaction id and not searching by transaction_id. please guide how to add…
0
votes
1 answer

Not able to put view in bottom of linearlayout

Hello im using linear layout which contains some text view and a image view and it is organized well but i want to add a banner ad but when i add layout_gravity"bottom" its not going to the bottom of the screen i have tried to add…
Vasant Raval
  • 257
  • 1
  • 12
  • 31
0
votes
1 answer

TextView inside fragment with layout_gravity set to center hides behind tabs in tabbed activity

I am trying to implement a scrolling fragment in the Tabbed activity. There's only a single TextView inside the fragment and it works fine as far as layout_gravity is not changed. But as soon as layout_gravity is set to center the content of the…
Vishal A.
  • 1,373
  • 8
  • 19
0
votes
1 answer

Android spinner background problem API 21

I created a drawable for my spinner background. It should draw a border and put an arrow to the right side of the spinner. It works perfectly with API 21+ devices as you see below ; But it doesn't work as i expected with API 21 and below devices.…
0
votes
1 answer

layout_gravity in LinearLayout not working as expected

The output for the following XML code-
jenny jenkins
  • 95
  • 1
  • 9
0
votes
0 answers

EditText gravity affects hint text but not input text

I am trying to make the input text inside an editText come out at the bottom of it. When I use , bottom the hint changes its position but the input text does not. This is my xml code: …
Chema
  • 15
  • 4
0
votes
1 answer

adding image in layout_gravity but doesn't work

I wanna put my logo to my app and layout_gravity doesn't work, neither found in Android Studio why? maybe there is another option for this, maybe by version i don't know, below I share the code in XMl.
0
votes
2 answers

How to place two views on opposite side of LinearLayout

How can I place the ImageButton on the right side of the screen ? I think it has to do with "layout_gravity" property, but I can't manage to figure out how to do it. Here is the XML file that creates each line :
LoneRetriever
  • 119
  • 10
0
votes
2 answers

The difference between vertical and horizontal orientation about layout_gravity and gravity

I have a TextView in a LinearLayout. I want to try different modes for layout_gravity and gravity. I have this code:
user2111639
  • 287
  • 2
  • 5
  • 15
0
votes
0 answers

Gravity:End is not taking effect Programmatically

I am giving gravity:end in xml and it shows at the right side in Android Studio. (go end) but programmatically doesn't work. layout_gravity:end in chat_image worked just in Android Studio preview but it's not working programmatically. changed…
0
votes
1 answer

I can't center listView in android

ListView not being centered Buddy, What's the problem in this listView? I can't solve the problem no matter what I do.