Javascript Sencha Touch-另一个视图未显示在选项卡面板上
单击适当的选项卡时,在主视图上显示设置视图有问题。以下是主视图的代码:Javascript Sencha Touch-另一个视图未显示在选项卡面板上,javascript,sencha-touch-2,sencha-touch-2.3,Javascript,Sencha Touch 2,Sencha Touch 2.3,单击适当的选项卡时,在主视图上显示设置视图有问题。以下是主视图的代码: Ext.define('App.view.Main', { extend:'Ext.tab.Panel', requires: [ 'App.view.SettingsView' ], config: { fullscreen: true, tabBarPosition: 'bottom', items: [ { title: 'About',
Ext.define('App.view.Main', {
extend:'Ext.tab.Panel',
requires: [
'App.view.SettingsView'
],
config: {
fullscreen: true,
tabBarPosition: 'bottom',
items: [
{
title: 'About',
iconCls: 'info',
items: {
docked: 'top',
xtype: 'titlebar',
title: 'Home Screen'
},
html: 'Home Screen'
},
{
title: 'Maps',
iconCls: 'maps',
items:
{
docked: 'top',
xtype: 'titlebar',
title: 'Maps Screen'
},
html: 'Maps Screen'
},
{
title: 'Setiings',
iconCls: 'settings',
items: [
{
docked: 'top',
xtype: 'titlebar',
title: 'Settings'
},
{
xtype: 'settingsview',
id: 'settingsview'
}
]
}
]
}
});
这是设置视图的代码:
Ext.define('App.view.SettingsView', {
extend: 'Ext.form.Panel',
xtype: 'settingsview',
requires: [
'Ext.form.FieldSet',
'Ext.field.Toggle',
'Ext.field.Select',
'Ext.field.Text',
'Ext.Button'
],
config: {
xtype: 'fieldset',
title: 'SettingsView',
instructions: 'In case you do not want the app to detect your location you can enter the city and country.',
items: [
{
name: 'geo',
xtype: 'togglefield',
label: 'Auto detect?',
labelWidth: '55%',
value: '1',
},
{
name: 'units',
xtype: 'selectfield',
label: 'Units',
options: [
{
text: 'Fahrenheit',
value: 'f'
},
{
text: 'Celsius',
value: 'c'
}
]
},
{
name: 'city',
xtype: 'textfield',
label: 'City',
disabled: true
},
{
name: 'country',
xtype: 'textfield',
label: 'Country',
disabled: true
},
{
xtype: 'button',
text: 'Refresh',
action: 'refresh',
margin: '10 5',
ui: 'confirm'
}
]
}
});
启用“设置”选项卡时,它仅显示标题栏和选项卡栏。没有错误消息。我做错了什么 尝试在设置视图内的配置中添加布局:'fit'
或
修改主视图
{
title: 'Setiings',
iconCls: 'settings',
layout: 'vbox',
items: [
{
docked: 'top',
xtype: 'titlebar',
title: 'Settings'
},
{
xtype: 'settingsview',
id: 'settingsview',
flex: 1
}
]
}
非常感谢你,萨沙,你救了我一天!第一个解决方案为我解决了两个问题,现在它确实显示了设置和地图!呃,我知道,我在乞讨中也损失了很多时间。如果你同意,请接受我的回答: