Question about scaled pixels and edge of screen

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Question about scaled pixels and edge of screen

Postby jonnale » Thu Feb 04, 2010 10:00 pm

So I am writing an app where I want the buttons to be at the very edge of the screen. There are two buttons, one on the left side of the screen, one on right side. I went the left edge of the left button to be on the left edge of the screen, and the right edge of the right button to be on the right edge of the screen.



(note: the dots are there just to indicate blank space. The forum adjusted the layout when I simply put spaces there)

The way I am currently doing it is simply by setting a margin on the right button to some value, say 150sp (I don't know if that's correct, I just don't feel like pulling up the .xml file to get the value). I am not really sure I understand the idea of scaled pixels. For example, on my Droid, this in fact puts the right button at the edge of the screen. However, I don't want it so that a device with a smaller screen with less pixels (such as the G1) renders the button off the screen.

In other words, if the edge of the screen is a margin of 150sp on the Droid, will it be the same on a G1 or any device with a smaller screen? Is there any simpler way to set it so that an object (in this case a button) is located at the edge of a screen?

Thanks in advance!
Junior Developer
Junior Developer
Posts: 22
Joined: Wed Dec 30, 2009 11:02 pm


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 3 guests