【问题标题】:Unable to set button icon with ImageDownloadService (EncodedImage)无法使用 ImageDownloadService (EncodedImage) 设置按钮图标
【发布时间】:2014-06-08 22:04:40
【问题描述】:

我对 ImageDownloadService 有疑问。下面是我的代码。如果我使用标签,我可以显示从服务器下载的图像。但是,如果我使用按钮,则不会显示任何内容。我已将占位符设置为按钮的初始图标。请问我做错了什么?

EncodedImage eImg = EncodedImage.findButton(f).getIcon();
Image i = URLImage.createToStorage(eImg, "MyStoredImage.jpg", "http://ImgURL.png", URLImage.RESIZE_SCALE);

//now set the ad image to downloaded image
findButton(f).setIcon(i);

如果我改用findLabel(f).getIcon()findLabel(f).setIcon(i),代码可以工作,但对于 Button 则不行。这是为什么呢?

提前致谢。

【问题讨论】:

    标签: codenameone


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-14
      相关资源
      最近更新 更多