iOS Question Scrollview question

mrossen

Active Member
Licensed User
Longtime User
Hi,

I have a scrollview there is set to 100%x Width and 100%y in designer script.

When i load a layout into it the layout Width is only set to what scrollview.contentwidth is. Ex 100

Is there a way to set scrollview.contentwidth to 100%x and scrollview.contentheigth to 100%y

Whar I need is max screenwidth im my scrollview

Mogens
 

klaus

Expert
Licensed User
Longtime User
I have a scrollview there is set to 100%x Width and 100%y in designer script.
TO set the Width and Height to 100% you don't need to do it in the DesignerScripts, just set the HorizontalAnchor and VerticalAnchor properties to BOTH. Check that the Right Edge Distance and Bottom Edge Distanve properties are 0.

You can set the ContentWidth and ContentHeight in the Page1_Resize routine.

If you have Width = 100%x and Height = 100%x and you set ContentWidth = 100%x and ContentHeight = 100%y why do you use a ScrollView because there will be no scrolling?
 
Upvote 0

mrossen

Active Member
Licensed User
Longtime User
Thanks for the reply.

This make my layout more simple :)

But I still have a problem.

When "AutoScaleAll" is active my layout scales up and my scrollview isn't dosn't have the right height.

Do I have to disable AutoScalleAll when using scrollview

I have attached a sample project with my problem

Mogens
 

Attachments

  • Testlayout.zip
    3.8 KB · Views: 203
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Why don't you use CustomListView?

In your project, changing the ContentHeight property in the Designer changes the visible part on the device !?
If I understand correctly then you are seeing the inner panel (the grey panel). I don't see a problem here.

You shouldn't use AutoScaleAll for the second layout.

What happens here is that there is a circular dependency between Panel1.Height which affects ScrollView.ContentHeight which then affects Panel1.Height again.
The value of Panel1.Height is not accurate in Page_Resize event as it was not yet resized.

The ContentHeight is not auto scaled. So it doesn't work automatically.
 
Upvote 0
Top