TomR
TomR

Reputation: 3056

How to configure right vertical scroll for Delphi FMX Android TFramedVertScrollBox?

I have Delphi FMX Android TFramedVerScrollBox with:

Margins.Right:=20;
ShowScrollbars:=True;
TouchTargeExpansion.Right:=80;
Width:=800;

which has a set of TLayout components as a set of children with individual settings for each TLayout:

Align:=Top;
Anchors:=[akLeft, akTop, akRight]
Size.Wdith:=800; //But I guess this is irrelevant, as Size should be determined automatically for children with Align:=Top

My question is - how can I set properties in a way, that:

Upvotes: 0

Views: 208

Answers (1)

Softacom
Softacom

Reputation: 643

First : "Padding" adds space to the inner side of the control (between the control borders and its children), while "Margins" adds space to the outer side of the control (to the borders of its Parent or between the control borders and another control within the same Parent).

So when you need to set distance between a TLayout and its "Parent" border (Right border of the TFramedVertScrollBox) then you must go either for Padding in the TFramedVertScrollBox or for Margins in its children controls.

But it is not necessary to set space for scrollbars. Because when a scrollbox (in Delphi apps like in anywhere else) is resized and its children are not completely visible, the scrollbox client area is resized automatically for letting space for showing scrollbars. And even if you set "Margins" for children controls, the scrollbox client area is resized and the children margins are moved. So you will get more margins that will ruin your UI design.

That size adaptation is common on Windows where the scrollbars are always completely shown with their classical aspect. While on Android, scrollbars are not explicitly shown, you may only see their "thumbs" when you try to drag on the side having the scrollbar.

Second : The width of the scrollbar in TFramedVertScrollBox, like all layout controls, is defined by the style. You have to customize the style or create your own style where you can set the size and even the position of the scrollbar.

Upvotes: 1

Related Questions