Then just write your own layout manager that does your own special
positioning algorithm.  This is likely to be faster than using
AbsoluteLayout, anyway, especially if the screen dimensions change on you
and you need to do a relayout.

On Tue, Feb 10, 2009 at 3:15 PM, Sundog <sunns...@gmail.com> wrote:

>
> 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 <hack...@android.com> 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, cycleme...@gmail.com
> > <cycleme...@gmail.com>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
> > hack...@android.com
> >
> > 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 -
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

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.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to