Display Issue

Paladium

Member
Licensed User
Longtime User
Hi there,

I got a problem with display sizes and resolutions.

I own a lg optimus one with 320x480x180dpi

This is what the activity looks on my device:

480px

And on desire 480x800x260dpi:

800px

I created other scrollviews and there it worked on bigger resolutions with no problem.

Here the code in short (sample):

B4X:
Dim br_scr1 As ScrollView
Dim bra As ImageView

br_scr1.Initialize(400dip)
bra.Initialize("bra")

Activity.LoadLayout("braillescreen")
br_scr1.Panel.AddView(bra,5,5,40,60)

bra.Bitmap = LoadBitmap(File.DirAssets,"br_a.png")
bra.Gravity = Gravity.CENTER

Can someone please help me with this issue? Any help is appreciated.
Thanks in advance.

Markus
 

klaus

Expert
Licensed User
Longtime User
Your line
B4X:
br_scr1.Panel.AddView(bra,5,5,40,60)

should be
B4X:
br_scr1.Panel.AddView(bra,5dip,5dip,40dip,60dip)
In the first case the values are pixels.
In the second case the values are density independant pixels and will be adjusted according to the resolution.

Best regards.
 
Upvote 0
Top