我使用fieldset设计编辑表单。例如,
items: [
{
xtype: 'textfield',
name: 'nameEn',
label: 'Name (English)',
placeholder: '',
autoCapitalize: false,
required: true,
clearIcon: true
},
{
xtype: 'textareafield',
name: 'descriptionEn',
label: 'Description (English)'
},
{
xtype: 'togglefield',
name: 'verified',
label: 'Verified'
}
]现在我需要照片(用于查看,但将来可能会上传/删除)。我不知道该怎么办。
发布于 2013-02-05 22:48:27
对于显示,您可以使用xtype:image (documentation here),而对于上传,您可以使用带有inputType:'file'属性的xtype:textfield。但是,您应该注意到,在iOS上,您可能无法在不打包应用程序的情况下进行文件上传(如this forum post中所述)。如果您希望用户能够使用相机拍照,您可以使用按钮,并在处理程序中使用Ext.device.Camera component。
如果你想要多张照片,你可能需要在你的image组件周围使用一个hbox layout。
祝好运!
编辑:这是一个使用hbox布局和水平滚动的panel示例。基本上,这是你可以用Sencha Touch制作的最简单的图片库(我认为):
{
xtype: 'panel',
layout: 'hbox',
scrollable: { direction: 'horizontal' },
items: [
{
xtype: 'image',
src: 'path/to/image.png'
},
{
xtype: 'image',
src: 'path/to/another/image.jpg'
},
...
]
}https://stackoverflow.com/questions/14706531
复制相似问题