Different densities

magarcan

Active Member
Licensed User
Longtime User
My app has only one layout defined, 320x480 (160dpi). I've used my Galaxy S to set up my layout. The problem is that I've been testing mi app in different devices (HTC Magic and Nexus One) an there a re some problems.

HTC Magic: HVGA (320 X 480 píxeles)
Nexus One: WVGA (480 X 800 píxeles)
Galaxy S: WVGA (480 X 800 píxeles)

Nexus and Galaxy work Ok, the problem is with Magic. I've been looking for this in Internet and I've found this:

Hardware Property for Abstracted LCD Density of Magic: “180”
Hardware Property for Abstracted LCD Density of Nexus and Galaxy: “252”

How can I solve this? Thanks
 

magarcan

Active Member
Licensed User
Longtime User
At the bottom of the webview, there are 2 lines missing:
cosaci.png


The lost lines can be seen in my mobile or in emulator with Nexus One settings.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Now I see. The nexus one screen is slightly longer than 320x480. You can either create the layout with the emulator (which is the recommended way) and then there will be some empty space at the bottom of the nexus one. Or create another variant for the nexus one, or adjust the WebView height programmatically.
If you want to create another variant then you can use: 320x533, scale=1 or 480x800, scale=1.5.
 
Upvote 0

magarcan

Active Member
Licensed User
Longtime User
As Nexus One and Glaxy S works ok, I think the best options y adjunt layout for HTC Magic. How can I adjust the WebView height programmatically?
 
Upvote 0

magarcan

Active Member
Licensed User
Longtime User
This is how I finally do:
B4X:
WebView1.Height = (Activity.Height-WebView1.Top)'Posición Top del WebView
 
Upvote 0
Top