Codenameone 如何在codename one中使用标题动画

Codenameone 如何在codename one中使用标题动画,codenameone,Codenameone,请问我如何使用标题动画在CN1动画图片在src目录。我遵循了使用示例代码的开发人员指南。当我运行代码时,图片没有执行任何动画。我想修改这段代码以迭代src目录中的图片,这样我就可以有例如img1、img2、img3。显示在标题栏上。请告诉我怎么做 这是我使用的代码 Form hi = new Form("Toolbar", new BoxLayout(BoxLayout.Y_AXIS)); EncodedImage placeholder = EncodedImage.createFromIm

请问我如何使用标题动画在CN1动画图片在src目录。我遵循了使用示例代码的开发人员指南。当我运行代码时,图片没有执行任何动画。我想修改这段代码以迭代src目录中的图片,这样我就可以有例如img1、img2、img3。显示在标题栏上。请告诉我怎么做

这是我使用的代码

 Form hi = new Form("Toolbar", new BoxLayout(BoxLayout.Y_AXIS));
EncodedImage placeholder =
EncodedImage.createFromImage(Image.createImage(hi.getWidth(),
hi.getWidth() / 5, 0xffff0000), true);
URLImage background = URLImage.createToStorage(placeholder, "400px-  AGameOfThrones.jpg","http://awoiaf.westeros.org/images/thumb/9/93/AGameOfThrones.jpg/400px-AGameOfThrones.jpg");
background.fetch();
Style stitle = hi.getToolbar().getTitleComponent().getUnselectedStyle();
stitle.setBgImage(background);
stitle.setBackgroundType(Style.BACKGROUND_IMAGE_SCALED_FILL);
stitle.setPaddingUnit(Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS,
Style.UNIT_TYPE_DIPS, Style.UNIT_TYPE_DIPS);
stitle.setPaddingTop(15);
     SpanButton credit = new SpanButton("This excerpt is from A Wiki Of Ice             AndFire. Please check it out by clicking here!");
credit.addActionListener((e) ->         Display.getInstance().execute("http://awoiaf.westeros.org/index.php/A_Game_of_Thrones"));
  add(credit);
     ComponentAnimation title =          hi.getToolbar().getTitleComponent().createStyleAnimation("Title", 200);
  hi.getAnimationManager().onTitleScrollAnimation(title);
  hi.show();

我可以在标题栏上显示图片,但它没有动画。

在我们使用源UIID和目标UIID重置状态时,您需要创建源UIID和目标UIID。您使用了
Style
对象操作,这是有问题的,因为它不能为我们提供一种方便地“重置”更改的方法

我们使用源UIID和目标UIID重置状态时,您需要创建源UIID和目标UIID。您使用了
Style
对象操作,这是有问题的,因为它不能为我们提供一种方便地“重置”更改的方法

请帮我翻译一段代码,以便更好地理解。谢天谢地,实际上这是相同的代码,没有样式操作,只需将样式设置放在主题中,而不是样式中。因此,没有代码可以提供。请您提供一个代码片段,以便更好地理解。谢天谢地,实际上这是相同的代码,没有样式操作,只需将样式设置放在主题中,而不是样式中。所以没有代码可以给出