[android-developers] Re: layout_gravity

2010-09-01 Thread vinix
provide orientation="vertical" in other button then make layout_gravity="right" On Aug 31, 10:42 am, William Ferguson wrote: > Thanks! that worked. > Still don't understand why its not working with a LinearLayout. > > On Aug 31, 1:56 pm, Floaters wrote: > > > > > Maybe you can try RelativeLayout

[android-developers] Re: layout_gravity

2010-09-01 Thread Zsolt Vasvari
> I believe that layout_gravity (for LinearLayout) probably only has an > effect if it specifies a direction that is orthogonal to the > orientation of the layout. > Ie if the LinearLayout orientation is horizontal then the only > acceptable layout_gravity options fors its children are top, bottom

[android-developers] Re: layout_gravity

2010-08-31 Thread William Ferguson
Thanks Mark, I think you managed to clarify for me why it's not working. And yes, I'm now convinced that RelativeLayout is the correct option in this case. I believe that layout_gravity (for LinearLayout) probably only has an effect if it specifies a direction that is orthogonal to the orientation

[android-developers] Re: layout_gravity

2010-08-31 Thread Mark Carter
LinearLayout is for when you want a continuous sequence of children in a line, one after another. From your description, that is not what you want (e.g. there may be a gap between the buttons depending on their sizes and the size of the parent). So a LinearLayout is not what you should be using.

[android-developers] Re: layout_gravity

2010-08-31 Thread Zsolt Vasvari
Note sure, I would go with Kostya's suggestion and try converting your LinearLayout to a RelativeLayout. It know it looks daunting at first, but it's fairly easy to use and you don't seem to get the gravity weirdess, as you don't need to use (or even can?) layout_gravity at all. It also appears t

Re: [android-developers] Re: layout_gravity

2010-08-31 Thread Kostya Vasilyev
Don't know if it's a bug, or something I misunderstand, but - for me, using "layout_gravity" produces the result I want more often than using "gravity". -- Kostya 31.08.2010 15:32, William Ferguson пишет: So do you think what I'm seeing is a bug with LinearLayout? It seems to be directly vi

[android-developers] Re: layout_gravity

2010-08-31 Thread parag
even i have found similar issues with the layouts. The user doc for layouts and actual implementation does not go hand in hand, its always a trial and error process Please do post if there is a clear solution for the above issues On Aug 31, 4:01 pm, Kostya Vasilyev wrote: >   As a general rule,

[android-developers] Re: layout_gravity

2010-08-31 Thread William Ferguson
So do you think what I'm seeing is a bug with LinearLayout? It seems to be directly violating the description of how layout_gravity is supposed to work. On Aug 31, 9:01 pm, Kostya Vasilyev wrote: >   As a general rule, layout_ refers to how that particular > view is positioned within its parent,

Re: [android-developers] Re: layout_gravity

2010-08-31 Thread Kostya Vasilyev
As a general rule, layout_ refers to how that particular view is positioned within its parent, while without "layout_" refers to the "insides" of the view. Even then, it's sometimes non-intuitive. I find myself using RelativeLayout more and more as it often can be used to replace several ne

[android-developers] Re: layout_gravity

2010-08-31 Thread Zsolt Vasvari
Honestly, I haven't met a person who really understands it well. It always seems to be a trial and error process. Layout_gravity seems especially troublesome. Where you swear it should work after the reading the docs and thinking about it, it does not. But it sometimes does. Go figure. On Aug

[android-developers] Re: layout_gravity

2010-08-30 Thread William Ferguson
Thanks! that worked. Still don't understand why its not working with a LinearLayout. On Aug 31, 1:56 pm, Floaters wrote: > Maybe you can try RelativeLayout... > > 2010/8/31 William Ferguson > > > OK, I'm obviously missing something fundamentally simple here. > > I have a LinearLayout containing

[android-developers] Re: layout_gravity

2010-08-30 Thread William Ferguson
That centers both buttons, so I still can't get the OtherButton right justified. On Aug 31, 1:53 pm, grace wrote: >  add android:gravity="center_horizontal" in the linear layout > > On Aug 31, 8:42 am, William Ferguson > wrote: > > > OK, I'm obviously missing something fundamentally simple here.

[android-developers] Re: layout_gravity

2010-08-30 Thread grace
add android:gravity="center_horizontal" in the linear layout On Aug 31, 8:42 am, William Ferguson wrote: > OK, I'm obviously missing something fundamentally simple here. > I have a LinearLayout containing 2 buttons. > I've coloured the layout background red so I can see that it has > expanded to

[android-developers] Re: layout_gravity does not center the control

2009-06-01 Thread Saurav Mukherjee
try changing the layout to table layout and use gravity arrtibute for the view in each row... it worked for me On Mon, Jun 1, 2009 at 5:39 PM, iDeveloper wrote: > Hi > I have a list, a web view and certain buttons on my activity's layout. > I am trying to center the web view in the layout. T

[android-developers] Re: layout_gravity does not center the control

2009-06-01 Thread iDeveloper
Thanks a lot. On 01-Jun-09, at 5:42 PM, Mark Murphy wrote: > > iDeveloper wrote: >> I have a list, a web view and certain buttons on my activity's >> layout. >> I am trying to center the web view in the layout. The layout_gravity >> attribute that I use for the webview doesn't seem to work.

[android-developers] Re: layout_gravity does not center the control

2009-06-01 Thread Mark Murphy
iDeveloper wrote: > I have a list, a web view and certain buttons on my activity's layout. > I am trying to center the web view in the layout. The layout_gravity > attribute that I use for the webview doesn't seem to work. It stays put > aligned to the left of the screen when I view the activity.