0
votes

I have an android app in Delphi 10 Seattle. I want to use a TVertScrollBox to show some content, it works great right now, but the scroll control is not visible unless you scroll. I see it has an auto-hide option, so I clicked that off. In Windows testing, I now see a horizontal and vertical scroll bar on my TVertScrollBox. In Android, it is still hiding and apparently ignoring autohide, but when you do scroll, now the vertical scroll handle appears AS WELL AS A HORIZONTAL SCROLLBAR!!! Come on Embarcadero!!! Why create a TVertScrollBox if you are not going to hide the Horizontal scroll in it? This is stupid.

My question: How do I get the vertical scroll bar to be visible so the user knows to scroll down to see more content? I want autohide off, and I definitely do not want the horizontal scroll bar visible at all.

I am calling RealignContent after changing the TLabel contents. All my controls are set to Align=Top, in this case, they are TLabels with AutoSize set to true and WordWrap set to true on the bottom one. I believe the solution is in style sheets, but I have not figured it out yet.

Thanks, Scott

2
Hiding vertical scroll bar is standard feature for Android. Most apps hide it because of small screens. Some apps (e.g. Telegram) shows small arrow that points in the bottom (only in case of unread messages) - that means that user can scroll down.alitrun

2 Answers

1
votes

The following is confirmed to work with Delphi 10 Seattle on Windows platform (Win 7), but I can not test on Android. Specifically, what you said about the vertical scrollbar remaining auto hiding even if you turned off auto hiding is unexpected.

To force the scrollbar(s) visible, as you already concluded, turn off AutoHide property.

Then to hide the horizontal scrollbar, modify the TVertScrollBox default style as follows:

  • Right click on the TVertScrollBox and select Edit Default Style ...
  • Open up scrollboxstyle: TLayout
  • Open up background: TLayout
  • Select hscrollbar: TScrollBar

In the properties of the selected hscrollbar

  • untick Visible
  • set Opacity to zero
  • set both Scale values to zero

Select Apply and Close button at the top of the designer window.

The horizontal scrollbar should now be invisible in the design view and at runtime.

Select the Android platform and do the same changes.

1
votes

The listbox in question is the drop-down box for a TComboEdit rather than a regular TListbox dropped on a form. If I edit the CustomStyle, I’m editing the style of the TComboBox and I can’t find any way to edit the style of the attached TListBox. I can’t do step 1 in that reply because there is no TVertScrollBox, just a TComboEdit.