Believe me, I see your point, but there are applications this simply
won't work for. Mine, for instance, requires up to 144 precisely
positioned, size-changing, overlapping-but-not-colocated buttons on
the screen (not in a grid), and there simply isn't any other way to do
it. I certainly understand the effort to get people to use more
structured layouts but there remain a few applications where there
simply isn't any other choice.

It would be nice it there were a system-friendly way to determine
screen sizes, but not writing the app because there isn't one is not
an option.

On Feb 10, 2:57 pm, Dianne Hackborn <[email protected]> wrote:
> The answer is you don't use AbsoluteLayout.  Seriously.  It is trivial to
> place a button at the bottom right corner of the screen with various other
> layout managers, and those will take care of doing the right thing for the
> actual screen space.
>
> On Tue, Feb 10, 2009 at 1:03 PM, [email protected]
> <[email protected]>wrote:
>
>
>
>
>
>
>
> > I've read many posts on the topic of screen width and height, but none
> > that answer the big question that seems to come up again and again.
>
> > I have an AbsoluteLayout.  I want to place a button in the bottom
> > right corner of the screen.  How do I get the size of the viewable
> > area so that I know where the bottom right of the screen is?
>
> > Things I've tried:
>
> > * displayMetrics.heightPixels - but then I have to hard code a guess
> > for the status bar size
> > * absoluteLayout.getLayoutParams().height - I've never seen reasonable
> > numbers coming from this (<= 0)
> > * Make the custom view the size of the whole screen, and use the
> > canvas object passed into onDraw(), but this object also shows a
> > height that doesn't take the status bar into consideration.  If I draw
> > something at y=479, it is now viewable because it is off the screen.
>
> > Thank you,
>
> > Matthew
>
> --
> Dianne Hackborn
> Android framework engineer
> [email protected]
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support.  All such questions should be posted on public
> forums, where I and others can see and answer them.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to