我使用CodeName One Designer添加了一个MutliImage。我已将图像添加为组件的背景。开始获得例外:
java.lang.ArrayIndexOutOfBoundsException: 0
at com.codename1.ui.util.Resources.readMultiImage(Resources.java:1096)
at com.codename1.ui.util.Resources.readMultiImage(Resources.java:1069)
at com.codename1.ui.util.Resources.createImage(Resources.java:1051)
at com.codename1.ui.util.Resources.createImage(Resources.java:961)
at com.codename1.ui.util.Resources.openFileImpl(Resources.java:306)
at com.codename1.ui.util.Resources.openFile(Resources.java:269)
at com.codename1.ui.util.Resources.<init>(Resources.java:189)
at com.codename1.ui.util.Resources.open(Resources.java:740)
at com.codename1.ui.util.Resources.openLayered(Resources.java:702)
at com.codename1.ui.util.Resources.openLayered(Resources.java:666)
at com.codename1.ui.plaf.UIManager.initNamedTheme(UIManager.java:1583)
at gymrush.pro.RushPro.init(RushPro.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.codename1.impl.javase.Executor$1$1.run(Executor.java:117)
at com.codename1.ui.Display.processSerialCalls(Display.java:1152)
at com.codename1.ui.Display.mainEDTLoop(Display.java:969)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.io.IOException: 0
at com.codename1.ui.util.Resources.open(Resources.java:755)
at com.codename1.ui.util.Resources.openLayered(Resources.java:702)
at com.codename1.ui.util.Resources.openLayered(Resources.java:666)
at com.codename1.ui.plaf.UIManager.initNamedTheme(UIManager.java:1583)
at gymrush.pro.RushPro.init(RushPro.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.codename1.impl.javase.Executor$1$1.run(Executor.java:117)
at com.codename1.ui.Display.processSerialCalls(Display.java:1152)
at com.codename1.ui.Display.mainEDTLoop(Display.java:969)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
我删除了图片和样式,没有任何帮助。甚至创建了一个新主题并删除了旧主题,同样的问题。也尝试使用:
public void init(Object context) {
theme = UIManager.initNamedTheme("/theme", "rush-pro");
}
这里没有运气。我会从头开始重新构建主题并重新开始,但是如何在不启动新项目的情况下执行此操作?
也许有更好的方法来解决问题?