Autoscaleall and FullScroll?

elck

Member
Licensed User
Longtime User
Hi I used AutoScaleALL which works fine.
Except HorizontalScrollView1.FullScroll(True) does not scroll all the way, and what's more manually moving the HorizontalScrollView does not scroll all the way either.

Is there a workaround?

Thanks,
Elck
 

Harris

Expert
Licensed User
Longtime User
Try:
ScrollView1.Height = -1

or

ScrollView1.Width = -1

Set scroll to use full parent panel - I've been told. Worked for me.

Thanks
 
Upvote 0

elck

Member
Licensed User
Longtime User
Hi,
I tried Harris` idea, but it filled the screen with the scrollview and then nothing scrolled.

Horizontalscrollview1.width=300
Horizontalscrollview1.height=400 while the variant = 320x480

this is how I load the view:

B4X:
Activity.LoadLayout("scrollview")
HorizontalScrollView1.Panel.LoadLayout("voorscherm")
HorizontalScrollView1.Color=Colors.Yellow

On the photo's you can see the result.
I also included the bal for the scrollview and voorscherm as I think maybe the problem lies there?

Thanks
 

Attachments

  • P1010975.JPG
    P1010975.JPG
    24 KB · Views: 245
  • P1010974.JPG
    P1010974.JPG
    26.6 KB · Views: 249
  • voorscherm.bal
    8.3 KB · Views: 175
  • scrollview.bal
    2.6 KB · Views: 155
Upvote 0

klaus

Expert
Licensed User
Longtime User
What exactly do you expect?
The views in the layout you are loading fit into the screen so nothing will scroll.
Could you explain what you want to do.
You have 30 ImageViews but two one on top of the other ?
In the voorscherm layout you have Panel1 what is this for ?

Best regards.
 
Upvote 0

elck

Member
Licensed User
Longtime User
Hello Klaus, thanks for answering.
The views in the layout you are loading fit into the screen so nothing will scroll.
Sorry, I find this is not the case, when you create one .bal containing only 1 HorizontolScrollView
And another one containing only one imageview, then proceed to load them as I described above (Activity.LoadLayout("one") then HorizontalScrollView1.Panel.LoadLayout("anotherone") you will see that things do scroll.

Now add AutoScaleALL to both designs and you will see that the amount scrolled is less than in the first instance.

In fact I think that the distance scrolled in absolute terms is the same, but it should not be the same but further as all distances have become larger.

That is what I tried to explain in my first posting.

I guess I will have to calculate the amount to scroll myself, but then I have to know what the distances have become after autoscale did its re-calculations.
Is there an easy way to know the scalingfactor?

regards,
Elck
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Yes you must calulate the width of the inner Panel of the HorizontalScrollView yourself.
The equations of autoscale are:
B4X:
delta = ((100%x + 100%y) / (320dip + 430dip) - 1)
rate = 0.3 'value between 0 to 1. 
scale = 1 + rate * delta
The default rate value is 0.3

Best regards.
 
Upvote 0
Top