G GaNdAlF89 Active Member Licensed User Longtime User Nov 21, 2012 #1 Hi, I have a question about the dimension of components in my activity... Example: I have a label and two buttons, I set their dimensions (height and width) according to dimension of display in my smartphone. What can I do to make "autoresizeable" the components, so that if I run my app on my tablet, the label and the buttons are proportionate according to new dimensions of display?
Hi, I have a question about the dimension of components in my activity... Example: I have a label and two buttons, I set their dimensions (height and width) according to dimension of display in my smartphone. What can I do to make "autoresizeable" the components, so that if I run my app on my tablet, the label and the buttons are proportionate according to new dimensions of display?
M MLDev Active Member Licensed User Longtime User Nov 21, 2012 #2 You can use %x and %y. e.g. 50%x means 50% of the Activity width and 50%y means 50% of the Activity height. See "Special functions like 50%x, 50dip" in the beginner's guide. Upvote 0
You can use %x and %y. e.g. 50%x means 50% of the Activity width and 50%y means 50% of the Activity height. See "Special functions like 50%x, 50dip" in the beginner's guide.
G GaNdAlF89 Active Member Licensed User Longtime User Nov 21, 2012 #3 Can you post an example code? And how can I do with coordinates (left and top)? Thanks... Upvote 0
M MLDev Active Member Licensed User Longtime User Nov 21, 2012 #4 This will add a label 1/4 the size of the Activity in the center: Code: Activity.AddView(lblMyLabel, 25%x, 25%y, 50%x, 50%y) Upvote 0
This will add a label 1/4 the size of the Activity in the center: Code: Activity.AddView(lblMyLabel, 25%x, 25%y, 50%x, 50%y)
Erel B4X founder Staff member Licensed User Longtime User Nov 22, 2012 #5 The best option is to use AutoScaleAll in the designer script. Upvote 0
G GaNdAlF89 Active Member Licensed User Longtime User Nov 22, 2012 #6 and about the automatic Text Size? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Nov 23, 2012 #7 Designer Scripts Tutorial AutoScaleAll takes care of text size as well. Upvote 0