Scale views

webmaas

Member
I already described my Problem in the german forum. Sorry for this double post but I am hoping for a little more answers. Maybe someone can close the other thread in the german forum?!

Actually I've got two questions. First: I'd really like to use the designer to place the views and to size them. But there are some difficulties. I determine the screen resolution in the activity_create-Sub. The screen resolution ought to affect the position and the size of all views within the current activity. Is there a way to place views using the designer and passing values like a new size or position to them at runtime? Or is it possible to init a global variable that gets a value before the layout gets loaded and that the layout can access? I've got a lot of buttons and other views that all get parameters like "width = 48 * scaleX". What would be the best way to pass the scale-Vars to all views?

Second: Why could it be wrong or dangerous to use dip to set size or position attributes of an element? I am using the LayoutValues.GetDeviceLayoutValues-Sub to determine the resolution of the device. The scale factor is the relation between the resolution the images are made for and the resolution the device actually uses. Could this be wrong or dangerous? Somewhere I read that there would be felt differences in the size of elements on several devices.

Thanks in advance!
 
Top