Android Question What is the correct use dip or %x (%y)

ronovar

Active Member
Licensed User
Longtime User
I have programmed apk (witch is currently in adding new feautures) and have one question...i use to define labels panels bitmaps etc in dip units not %x and %y...and the problem is:

- i tested apk in two same android box (MXIII) and on first box all is ok (images gravity fill centered, lables like it should be with height and width) and on second box imageview gravity bitmaps are large, labels width and height are half cut and i don't know why is this (same two boxes, same android version 4.2.2 and same resolution 1920x1080p).

I use to declare labels and image view like this:

B4X:
pnlMaster.AddView(lblEPGName, 150dip, 33dip, 250dip, 25dip)
imgChLogo.Initialize("imgChLogo")
imgChLogo.Bitmap = bmpChLogo
imgChLogo.Gravity = Gravity.Fill
pnlSlave.AddView(imgChLogo, 90dip-bmpChLogo.Width /2, 24dip-bmpChLogo.Height /2, bmpChLogo.Width, bmpChLogo.Height)
[CODE]

So what is the best approach to use dip or %? To be same on all android devices?
 
Top