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
> 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
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
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.
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
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
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,
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,
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
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
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
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.
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
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
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.
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.
16 matches
Mail list logo