如何停止动画闪烁

时间:2014-03-20 16:30:21

标签: codenameone

是否有一些停止显示闪烁的通用技术?我猜我有两个布局动画正在争夺控件或其他东西 - 这似乎发生在我的应用程序中的几个地方(因此是一般性问题)。

我会尝试更具体: 我有一个Box Layout Y Container,其中包含MultiButton个列表。 MultiButtons是我自己的类,它继承了MultiButton。当我从另一个表单回到Form时,它(所有按钮)都会轻弹。在beforeForm函数中,我这样做:

for (my loop)
{
MultiButton mb = new MultiButton();
...init code for mb, like setTextLine1();
container.addComponent(mb);
lastMb = mb;
}
container.revalidate();
container.scrollComponentToVisible(lastMb);

1 个答案:

答案 0 :(得分:0)

在显示表单之前调用beforeForm方法,因此不需要在该阶段重新验证(显示隐式执行此操作)。

什么是scrollToComponent?如果你删除它会闪烁吗?

要滚动到没有动画的组件,请执行以下操作:

container.setSmoothScrolling(false);
container.scrollComponentToVisible(cmp);
container.setSmoothScrolling(true);
相关问题