activity width?

hackhack

Active Member
Licensed User
Longtime User
Activity width and height, are those values in DIP?

(Or do they need to be DIPified for computations?)
 

margret

Well-Known Member
Licensed User
Longtime User
Activity Values

Activity width and height, are those values in DIP?

(Or do they need to be DIPified for computations?)

B4X:
DipToCurrent (Length As Int) As Int
Scales the value, which represents a specific length on a default density device (Density = 1.0),
to the current device.
For example, the following code will set the width value of this button to be the same physical size
on all devices.
Button1.Width = DipToCurrent(100)

Note that a shorthand syntax for this method is available. Any number followed by the string 'dip'
will be converted in the same manner (no spaces are allowed between the number and 'dip').
So the previous code is equivalent to:
Button1.Width = 100dip 'dip -> density independent pixel

Hope this helps.

Thanks,

Margret
 
Upvote 0
Top