240dpi question

kanaida

Active Member
Licensed User
Longtime User
I used the designer to add all the variants listed and arranged the contents properly.

On my tablet (Cube U30GT-H, 1280x800 160dpi) it looks and works fine down to the pixel.

On my phone (LG Connect 4G, 480x800 240dpi) It is just not wide enough to fit the phone's screen. I'd say it's about 72pixels extra on the right in landscape, and about 10 pixels extra in portrait.

Ok, so i figured let's make new layouts. 480x800/800x480 1.5 scale. This gives me a warning that i'm a bad person for even thinking about this, so I go ahead and click normalize.

Whoa, 533x320 I say. That's kind of strange... looking...
I made it this way and for 240dip. It made it closer to what what it *should* look like, but I still have a white line on the entire right side. The size of a webview scrollbar.

I'm not sure what i'm doing wrong here. Maybe it's a difference between webviews in jellybean and gingerbread?

all my app consists of are 4 webviews side by side for tablet sizes, and only 2 for smaller sizes (the other 2 are way out of view on purpose). Think Gmail layout, and dual Gmail side by side for tablets (2 users):

Portrait:
[WebView1 (x=72)] [Webview2 (x=248)]

Landscape:
[WebView1 (x=72)] [Webview2 (x=461)]

Any ideas how I can get this right? I'm trying to make sure I support all devices without resorting to multiplying percentages. Mainly because the layouts are different in different sizes.
 
Last edited:

kanaida

Active Member
Licensed User
Longtime User
Thanks,

I haven't tried those yet. Usually do that in the code.
Will something like this reliably?

If 100%x < 800 then
wv1.width = 70
wv2.width = 100%x -70
wv3 and 4 = off the screen.
Else
Same as above but with 4 views showing
(70px, (100%x-140 /2), (100%x-140 /2), 70px)
End If ?
 
Upvote 0
Top