我使用vbox和hbox layout在sencha中创建了一个布局。但问题是当我使用textfield和textareafield时,即使屏幕大小不同,它的大小也保持不变。
我在谷歌搜索了很多,发现很多人都有同样的问题。
以下代码
Ext.define('GS.view.RequestNew', {
extend : 'Ext.form.Panel',
xtype: 'requestnew',
requires: [
'Ext.Label',
'Ext.Img',
'Ext.field.TextArea'
],
config: {
title : 'Test',
iconCls: 'favorites',
layout:'fit',
items: [
{
xtype: 'panel',
layout: 'vbox',
items: [
{
flex: 1,
layout: 'vbox',
items: [
{
flex: 9,
layout: 'vbox',
style: 'background-color: #A96D13;',
items : [{
flex: 1,
layout: 'vbox',
items:[{
flex: 1,
layout:'vbox',
items: [{
flex: 1,
layout:'vbox',
style:'background-color: #C48627;',
margin : '6px 6px 6px 6px',
items:[{
flex: 1,
layout:'vbox',
style:'background-color: #C48627;',
margin : '6px 6px 6px 6px',
items:[
{
flex: 1,
layout:'vbox',
items: [{
flex: 1,
layout:'vbox',
items:[
{
flex: 1,
xtype: 'label',
html: 'Source Location',
style: 'color:white;font-weight:bold;margin-top:21px;'
},
{
flex: 1,
layout:'hbox',
items:[
{
flex: 7,
layout: 'fit',
items : [{
xtype: 'textfield',
name: 'location',
height: 45,
maxRows: 10,
maxHeight: 10,
autoMaximize: true
}]
},
{
flex:1,
style:'background-color: #FEDE65;',
xtype: 'image',
src: 'http://abc/resources/images/img_dropdown_icon.png'
}
]
}
]
}]
}
]
}]
}]
}]
}]
}
]
}
]
}
]
} });