Adding Views to ScrollView from the Designer.

Pantelis

Member
Licensed User
Longtime User
Hi

I add a scrollview with the Designer. How to add other Views on that ScrollView? I don't find any way to add those views from the Designer.
Is there any way?

Thanks
 

Pantelis

Member
Licensed User
Longtime User
Thank your Erel.
I am trying to make a layout for my Scroll View. I know how may dips in width and height i need totaly for my Views so i set ScrollView with those dimensions in dips. And then i try to create the layout with the same dimensions. When i create a new layout i must create a new variant layout? In the new variant window i must set the Width and Heigth in pixels.

I try to create a Variant with 100x100 scale 1 and then i add a button 100dip by 100dip to see if fits corectly. The width fits exactly but the height of the variant layout is half of the size of my button. Then i try to create a new variant layout 400x400 and add a new button 400dip by 400dip. This time the width of the variant layout also fits exactly with the button but the height are not the half as before but a little smaller than my button. Why this happns?
How to calculate the proper values in pixels so that the layout fits exactly on the Scrollview?
 
Upvote 0

Pantelis

Member
Licensed User
Longtime User
Hi Klaus. Thank you for reply.

I find your third link usefull.
So, the views can be placed outside the limits of scrollviewlayout with no problem and there is no need to find the resolution of scrollviewlayout in pixels?

Why you use a panel with views on a scrollviewlayout and not just those views on the scrollviewlayout? This is necessary or optional?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
The panel is used to be able to add views outsides the screen area.
You can't do this without a panel.
You can 'move' vertically the panel in the Designer by changing the panels Top property with negative values.
If you have many views to add it would be better to add them in the code.

Best regards.
 
Upvote 0
Top