android - 我的 TVertScrollBox 不想在 Android 上滚动

标签 android delphi firemonkey tscrollbox

我在需要在 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/

相关文章:

c++ - Firemonkey:设置 TLabel 文本导致字符串索引超出范围异常

delphi - FireMonkey 应用程序中未声明的标识符 'GetProcAddress'

java - 将 ARCore 相机输入绘制到 Unity 纹理上

javascript - React native 网络连接在 Android 中有效,但在 IOS 中无效

delphi - 使用 Delphi 进行 JNI 编程

Delphi BASM 代码在针对 Win64 时出现错误。它可以转换为纯帕斯卡吗?

delphi - 暂时禁用 Delphi 中 TvertScrollBox 组件的滚动?

java - SpeechRecognizer 什么都不做......我错过了什么

android - 从 IntentService 调用时,HttpURLConnection 返回 404

delphi - 如何通过 DBExpress 在 ODBC 连接上设置属性?