我一直在测试Titanium的新ForgedUI插件,它有助于为Titanium应用程序创建UI元素。
我创建了UI并将其构建为JS代码。它现在看起来像this,app.js看起来像this
然而,当我为我的设备构建应用程序时,我收到以下错误:
`12-29 10:28:54.745: E/TiAPI(20029): --------added
12-29 10:28:54.764: E/TiAPI(20029): --------window created
12-29 10:28:54.764: E/TiAPI(20029): -------logo created
12-29 10:28:54.768: E/TiAPI(20029): -------searchbar created
12-29 10:28:54.772: E/TiAPI(20029): -------BT1 created
12-29 10:28:54.776: E/TiAPI(20029): -------BTN2 created
12-29 10:28:54.776: E/TiAPI(20029): ------- appSTUDIO logo created
12-29 10:28:54.780: E/TiAPI(20029): -------Bug report pic created
12-29 10:28:54.780: E/TiAPI(20029): ---------window created
12-29 10:28:55.128: E/TiApplication(20029): (main) [14,192] Sending event: exception on thread: main msg:java.lang.NumberFormatException: Unable to convert java.lang.Boolean; Titanium 1.8.0.1,2011/12/22 13:09,fbdc96f
12-29 10:28:55.128: E/TiApplication(20029): java.lang.NumberFormatException: Unable to convert java.lang.Boolean
12-29 10:28:55.128: E/TiApplication(20029): at org.appcelerator.titanium.util.TiConvert.toInt(TiConvert.java:307)
12-29 10:28:55.128: E/TiApplication(20029): at org.appcelerator.titanium.util.TiConvert.toInt(TiConvert.java:313)
12-29 10:28:55.128: E/TiApplication(20029): at ti.modules.titanium.ui.widget.TiUIText.handleKeyboard(TiUIText.java:297)
12-29 10:28:55.128: E/TiApplication(20029): at ti.modules.titanium.ui.widget.TiUIText.processProperties(TiUIText.java:145)
12-29 10:28:55.128: E/TiApplication(20029): at ti.modules.titanium.ui.widget.searchbar.TiUISearchBar.processProperties(TiUISearchBar.java:93)
12-29 10:28:55.128: E/TiApplication(20029): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641)
12-29 10:28:55.128: E/TiApplication(20029): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:449)
12-29 10:28:55.128: E/TiApplication(20029): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:441)
12-29 10:28:55.128: E/TiApplication(20029): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:427)
12-29 10:28:55.128: E/TiApplication(20029): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:456)
12-29 10:28:55.128: E/TiApplication(20029): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:81)
12-29 10:28:55.128: E/TiApplication(20029): at android.os.Handler.dispatchMessage(Handler.java:95)
12-29 10:28:55.128: E/TiApplication(20029): at android.os.Looper.loop(Looper.java:123)
12-29 10:28:55.128: E/TiApplication(20029): at android.app.ActivityThread.main(ActivityThread.java:3687)
12-29 10:28:55.128: E/TiApplication(20029): at java.lang.reflect.Method.invokeNative(Native Method)
12-29 10:28:55.128: E/TiApplication(20029): at java.lang.reflect.Method.invoke(Method.java:507)
12-29 10:28:55.128: E/TiApplication(20029): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
12-29 10:28:55.128: E/TiApplication(20029): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
12-29 10:28:55.128: E/TiApplication(20029): at dalvik.system.NativeStart.main(Native Method)
12-29 10:28:55.174: E/AndroidRuntime(20029): FATAL EXCEPTION: main
12-29 10:28:55.174: E/AndroidRuntime(20029): java.lang.NumberFormatException: Unable to convert java.lang.Boolean
12-29 10:28:55.174: E/AndroidRuntime(20029): at org.appcelerator.titanium.util.TiConvert.toInt(TiConvert.java:307)
12-29 10:28:55.174: E/AndroidRuntime(20029): at org.appcelerator.titanium.util.TiConvert.toInt(TiConvert.java:313)
12-29 10:28:55.174: E/AndroidRuntime(20029): at ti.modules.titanium.ui.widget.TiUIText.handleKeyboard(TiUIText.java:297)
12-29 10:28:55.174: E/AndroidRuntime(20029): at ti.modules.titanium.ui.widget.TiUIText.processProperties(TiUIText.java:145)
12-29 10:28:55.174: E/AndroidRuntime(20029): at ti.modules.titanium.ui.widget.searchbar.TiUISearchBar.processProperties(TiUISearchBar.java:93)
12-29 10:28:55.174: E/AndroidRuntime(20029): at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:641)
12-29 10:28:55.174: E/AndroidRuntime(20029): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:449)
12-29 10:28:55.174: E/AndroidRuntime(20029): at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:441)
12-29 10:28:55.174: E/AndroidRuntime(20029): at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:427)
12-29 10:28:55.174: E/AndroidRuntime(20029): at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:456)
12-29 10:28:55.174: E/AndroidRuntime(20029): at ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:81)
12-29 10:28:55.174: E/AndroidRuntime(20029): at android.os.Handler.dispatchMessage(Handler.java:95)
12-29 10:28:55.174: E/AndroidRuntime(20029): at android.os.Looper.loop(Looper.java:123)
12-29 10:28:55.174: E/AndroidRuntime(20029): at android.app.ActivityThread.main(ActivityThread.java:3687)
12-29 10:28:55.174: E/AndroidRuntime(20029): at java.lang.reflect.Method.invokeNative(Native Method)
12-29 10:28:55.174: E/AndroidRuntime(20029): at java.lang.reflect.Method.invoke(Method.java:507)
12-29 10:28:55.174: E/AndroidRuntime(20029): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
12-29 10:28:55.174: E/AndroidRuntime(20029): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
12-29 10:28:55.174: E/AndroidRuntime(20029): at dalvik.system.NativeStart.main(Native Method)
12-29 10:28:55.182: E/(482): Dumpstate > /data/log/dumpstate_app_error
`
感谢所有......
答案 0 :(得分:2)
我遇到了同样的问题,导致了自动资本化的看似错误的行为。
进一步挖掘它似乎自动资本化不应该保持真或假值(这在iOS中完全有效,而不是在Android中)。相反,它应该保持此处定义的contsant值:
对于自动更正,似乎我们可以将其设置为true或false。我现在在我的文本域中有以下几行,在Android和iOS上都没有任何问题:
autocaptalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
autocorrect: false,
答案 1 :(得分:1)
由于某种原因,Titanium不再识别这些行,因此在使用它们后立即崩溃。 擦除后,应用程序运行良好。
autocapitalization : false,
autocorrect : false
我会在Titanium的网站上发布错误报告。