Firemonkey ScrollBox错误 [英] Firemonkey ScrollBox Bug
问题描述
TGrid
继承自 TScrollBox
它也影响所有网格)。在我们的开发机器上,一切都可以正常工作,而另一些则发生错误。我们没有检测到系统之间的任何模式(我们检查了操作系统,图形硬件,DirectX版本)。 复制:
- 创建一个新的FireMonkey应用程序。在表单上放置一个
TScrollBox
。 - 将一个按钮添加到scrollBox并将其垂直位置设置为500000。
- 启动应用程序,当您滚动到滚动条的末尾时,检查按钮是否显示。
如果发生错误,按钮不可见。
使用网格时,会导致1-19047行正确显示,并且不显示19047及以上的所有行。有没有人有什么想法可能导致这一点吗?
或者任何想法我们如何更详细地识别问题?
在滚动出现各种问题后,我得出结论,滚动组件存在初始化问题firemonkey,表现为狡猾的滚动行为。有时候它会工作,有时它不会...
在想到我几次修复了这个问题之后,只有看到问题再次出现在随后的编译(或一个不同的操作系统),在添加所有子组件之后,调用组件的UpdateStyle方法已经取得了很大的成功。即该问题自添加呼叫以来没有重新出现...
例如。以下伪代码填充一个滚动组件,然后调用UpdateStyle,这似乎强制组件修复各种属性的无效设置 - Min,Max等。
for i:= 1 to x do
MyScrollComponent.AddObject(MyObject [i]);
MyScrollComponent.UpdateStyle;
希望这样也适合你...
We are experiencing what seems to be a strange bug in Firemonkey's ScrollBox component (since TGrid
inherits from TScrollBox
it also affects all grids). On some ouf our development machines, everything works fine, while on others the bug occurs. We failed to detect any pattern between the systems (we checked OS, graphics hardware, DirectX version).
Reproduction:
- Create a new FireMonkey application. Place a
TScrollBox
on the form. - Add a button to the scrollBox and set its vertical position to 500000.
- Start the application and check if the button is displayed when you scroll to the end of the scrollbox.
If the bug occurs, the button is not visible.
When using a grid, this leads to lines 1-19047 being displayed correctly and all lines from 19047 and above not displayed.
Has anybody any idea what could be causing this? Or any idea how we can identify the problem in more detail?
After having all sorts of problems with scrolling, I have come to the conclusion that there is an initialisation problem with scrolling components in firemonkey, which manifest in dodgy scrolling behaviour. Sometimes it will work and sometimes it will not...
After having thought that I fixed the problem several times, only to watch the problem reappear on a subsequent compile (or a different OS), I have had much success in calling the component's UpdateStyle method after adding all of the child components. I.e. the problem has not resurfaced since adding the call...
E.g. The following pseudo code populates a scroll component then calls UpdateStyle which seems to force the component to 'fix' invalid settings for various properties - Min, Max etc.
for i := 1 to x do
MyScrollComponent.AddObject(MyObject[i]);
MyScrollComponent.UpdateStyle;
Hope this works for you too...
这篇关于Firemonkey ScrollBox错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!