Dim wb2 As New weui
With wb2.AddInputGroup("", "ipg1", "筛选列表")
.AddInput("名称", "名称", "text")
ploader("up1", "图片", True) 'True表示允许上传多个文件
.AllowDelete = True '允许删除
.TextPosition = 0 '标题靠左
.Incremental = True '允许重复选择文件或连续拍照
.ScaleWidth = 500 '自动压缩图片宽度为400个像素,高度等比例压缩
.Accept = "image/*" '允许使用相册和相机
End With
End With
With wb2.AddButtonGroup("", "btg1", True)
.Add("btn1", "查询", "button").Attribute = ""
End With
With wb.AddDialog("form1", "dlg1", "筛选", wb2.BuildHtml("ipg1") & wb2.BuildHtml("btg1"))
.AddButton("btnOK1", "×").Attribute = "onclick = hide"
'.Kind = 1
End With
这样选择图片没反应
通过对比正常的Uploader用法,使用BuildHtml生成的上传控件,会缺少下面红框的内容,自行使用wb.InsertHTML方法补上
wb.InsertHTML("", "<div id=""up128_gallery"" name=""up128_gallery"" class=""weui-gallery"" style=""display:none"" data-autohide="""" data-images=""""><span class=""weui-gallery__img"" style=""background-image: url();""></span></div>")
此主题相关图片如下:1.png
认真看7楼我给的代码!!!!认真看图片里蓝色画线位置!!!