ArminKH Well-Known Member Jul 5, 2015 #1 hi before using Designer and Autoscaleall and autoscalerate i use this code to set my viewes size and position Code: Copy Sub AutoResizeAll Dim xx,yy,rr As Float xx=(((100%x)/320)/Density) yy=(((100%y)/480)/Density) rr = Min(xx,yy) For Each V As View In Activity.GetAllViewsRecursive V.Left=V.Left*rr V.Top=V.Top*rr V.Width=V.Width*rr V.Height=V.Height*rr Next End Sub above code works perfectly and my viewes scaled with a good Rate but for now if i want to Set Same Scale Rate by using AutoScaleAll from designer then Which Scale Rate must be Entered? 0.5?0.6?0.7? i want just same result thank u
hi before using Designer and Autoscaleall and autoscalerate i use this code to set my viewes size and position Code: Copy Sub AutoResizeAll Dim xx,yy,rr As Float xx=(((100%x)/320)/Density) yy=(((100%y)/480)/Density) rr = Min(xx,yy) For Each V As View In Activity.GetAllViewsRecursive V.Left=V.Left*rr V.Top=V.Top*rr V.Width=V.Width*rr V.Height=V.Height*rr Next End Sub above code works perfectly and my viewes scaled with a good Rate but for now if i want to Set Same Scale Rate by using AutoScaleAll from designer then Which Scale Rate must be Entered? 0.5?0.6?0.7? i want just same result thank u
Erel B4X founder Staff member Licensed User Longtime User Jul 5, 2015 #2 Your code is similar to using a scale rate of 1.0. Though auto scale all is more sophisticated than this code. It compares the chosen variant size to the actual device size. It doesn't assume that the variant size is 320x480. I don't think that it is a good solution to use a scale rate of 1.0. It means that your layout is stretched on large devices. Using anchors together with the default autoscale all will give better results. Upvote 0
Your code is similar to using a scale rate of 1.0. Though auto scale all is more sophisticated than this code. It compares the chosen variant size to the actual device size. It doesn't assume that the variant size is 320x480. I don't think that it is a good solution to use a scale rate of 1.0. It means that your layout is stretched on large devices. Using anchors together with the default autoscale all will give better results.
ArminKH Well-Known Member Jul 5, 2015 #3 Erel said: Your code is similar to using a scale rate of 1.0. Though auto scale all is more sophisticated than this code. It compares the chosen variant size to the actual device size. It doesn't assume that the variant size is 320x480. I don't think that it is a good solution to use a scale rate of 1.0. It means that your layout is stretched on large devices. Using anchors together with the default autoscale all will give better results. Click to expand... thank u but when i use AutoScaleAll then my viewes are a bit small on large devices what do you think about using a Scale Rate between 0.5 and 0.7 ? again layout is stretched on large devices And seem not good? Upvote 0
Erel said: Your code is similar to using a scale rate of 1.0. Though auto scale all is more sophisticated than this code. It compares the chosen variant size to the actual device size. It doesn't assume that the variant size is 320x480. I don't think that it is a good solution to use a scale rate of 1.0. It means that your layout is stretched on large devices. Using anchors together with the default autoscale all will give better results. Click to expand... thank u but when i use AutoScaleAll then my viewes are a bit small on large devices what do you think about using a Scale Rate between 0.5 and 0.7 ? again layout is stretched on large devices And seem not good?
LucaMs Expert Licensed User Longtime User Jul 5, 2015 #4 https://www.b4x.com/android/forum/threads/autoscale-code-module.23750/ Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jul 5, 2015 #5 Anchors and designer script are more important than scaling. In most cases the scale rate should be smaller than 0.5. Make sure to test the layout on tablets and phones (you can use the UI Cloud for that). Upvote 0
Anchors and designer script are more important than scaling. In most cases the scale rate should be smaller than 0.5. Make sure to test the layout on tablets and phones (you can use the UI Cloud for that).