我的一些视图,其中仅未在模拟器/设备上加载。虽然它在浏览器上加载正常。
我没有在日志中收到任何特殊错误,所以我在视图中开始删除项目。 最后我发现XCODE在识别某些xtypes方面存在问题,例如“fieldset”,“emailfield”,“passwordfield”等。 将“fieldset”更改为“container”并将字段更改为“textfield”后,我的视图已成功加载。很奇怪啊?
这发生在以下代码中:
/*
* File: app/view/loginformpanel.js
*
* This file was generated by Sencha Architect version 2.2.2.
* http://www.sencha.com/products/architect/
*
* This file requires use of the Sencha Touch 2.1.x library, under independent license.
* License of Sencha Architect does not include license for Sencha Touch 2.1.x. For more
* details see http://www.sencha.com/license or contact license@sencha.com.
*
* This file will be auto-generated each and everytime you save your project.
*
* Do NOT hand edit this file.
*/
Ext.define('MyApp.view.loginformpanel', {
extend: 'Ext.form.Panel',
config: {
baseCls: 'fbloginpanel',
id: 'loginformpanel',
itemId: 'loginformpanel',
layout: {
type: 'vbox'
},
scrollable: {
direction: 'vertical'
},
items: [
{
xtype: 'container',
flex: 20,
cls: 'fblogin',
layout: {
type: 'vbox'
},
items: [
{
xtype: 'container',
flex: 3,
cls: 'wholepageRelative'
},
{
xtype: 'container',
flex: 18,
cls: 'wholepageRelative',
layout: {
type: 'vbox'
},
items: [
{
xtype: 'container',
flex: 8,
docked: 'top',
layout: {
type: 'vbox'
},
items: [
{
xtype: 'fieldset',
flex: 2,
cls: 'loginmargin',
docked: 'top',
title: 'Existing User',
items: [
{
xtype: 'emailfield',
id: 'email1',
itemId: 'email1',
name: 'email1',
placeHolder: 'Email'
},
{
xtype: 'passwordfield',
id: 'password1',
itemId: 'password1',
name: 'password1',
placeHolder: 'Password'
}
]
},
{
xtype: 'button',
flex: 1,
cls: [
'loginmargin',
'Signbutton'
],
docked: 'bottom',
id: 'reglogin',
itemId: 'reglogin',
ui: 'round',
icon: '',
scope: this
}
]
},
{
xtype: 'container',
flex: 10,
layout: {
type: 'vbox'
},
items: [
{
xtype: 'container',
flex: 10,
layout: {
type: 'vbox'
},
items: [
{
xtype: 'fieldset',
flex: 4,
cls: 'loginmargin',
docked: 'top',
layout: {
type: 'vbox'
},
title: 'New User',
items: [
{
xtype: 'textfield',
id: 'username',
itemId: 'username',
name: 'username',
placeHolder: 'Username'
},
{
xtype: 'passwordfield',
id: 'password',
itemId: 'password',
name: 'password',
placeHolder: 'Password'
},
{
xtype: 'emailfield',
id: 'email',
itemId: 'email',
name: 'email',
placeHolder: 'Email'
},
{
xtype: 'passwordfield',
hidden: true,
id: 'hashpassword',
itemId: 'hashpassword',
label: 'ססמא',
name: 'hashpassword'
},
{
xtype: 'numberfield',
hidden: true,
label: 'Field',
name: 'bfacebook'
},
{
xtype: 'numberfield',
hidden: true,
label: 'Field',
name: 'bregister'
}
]
},
{
xtype: 'container',
flex: 4,
minHeight: 100,
layout: {
type: 'vbox'
},
items: [
{
xtype: 'button',
cls: [
'loginmargin',
'Regbutton'
],
docked: 'top',
id: 'regbtn',
itemId: 'regbtn',
ui: 'round',
icon: '',
scope: this
},
{
xtype: 'button',
cls: 'fbLoginbtn',
docked: 'bottom',
height: '',
id: 'fbloginbtn1',
itemId: 'fbloginbtn1',
ui: ''
}
]
},
{
xtype: 'container',
flex: 2,
docked: 'bottom',
height: 50
}
]
}
]
}
]
}
]
},
{
xtype: 'toolbar',
cls: 'registerToolbar',
docked: 'top',
items: [
{
xtype: 'button',
baseCls: 'backbtn',
docked: 'left',
height: '',
id: 'loginbackbtn',
itemId: 'loginbackbtn',
width: '18%'
}
]
}
],
listeners: [
{
fn: 'onLoginbackbtnTap',
event: 'tap',
delegate: '#loginbackbtn'
}
]
},
onLoginbackbtnTap: function(button, e, eOpts) {
//var Screen = Ext.ComponentQuery.query('#fbloginpanel');
Ext.Viewport.setActiveItem(Ext.ComponentQuery.query('#fbloginpanel')[0]);
//Ext.Viewport.show();
}
});
现在我在其他观点中遇到更多问题,即使没有这些情况。
有人有类似的问题吗? 请帮帮我。
答案 0 :(得分:0)
只是一个快速猜测,但您没有在您发布的课程中使用“requires”关键字。
完全有可能您的视图无法在模拟器或设备上加载,因为应用程序在构建后不知道如何解析这些xtypes,因为“开发”和“生产”模式非常不同。
作为最佳做法,请始终对班级使用的每个依赖项使用“要求”。