我在需要在 Android、iOS 和 Win32 上运行的 Delphi FireMonkey 应用程序中使用 TVertScrollBox。我的应用程序在 Win32 上运行良好,也就是说,当框大于可用区域时,我得到一个滚动条,我可以滚动它。
但是,在 Android 上,该框只显示尽可能多的项目,但拒绝滚动。预期的行为是我可以在框内拖动一个点并使框滚动。
相关代码如下:
with TVertScrollBox.Create( Self ) do
begin
Parent := Self;
Align := TAlignLayout.alClient;
// AddObject several times here...
UpdateStyle();
Visible := True;
end;
最佳答案
您必须确保放入 VertScrollbox 中的组件/对象比 VertScrollBox 更高/更高。
如果 VertScrollBox 内的组件更小或更短,VertScrollBox 将不会有任何效果
with TVertScrollBox.Create( Self ) do
begin
Parent := Self;
Align := TAlignLayout.alClient;
// AddObject several times here...
// try setting yourobject.Height to TVertScrollBox.Height*2
// align yourobject to alTop
UpdateStyle();
Visible := True;
end;
关于android - 我的 TVertScrollBox 不想在 Android 上滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19985765/