IOS中,
<label>
<span>美化checkbox的元素</span>
<input type="checkbox" />
</label>
在web中一般都会隐藏掉checkbox,然后用span来做美化input标签,所以当我们点击label元素的时候其实是会点击到label元素的;
但是,在IOS中并不能,在IOS中需要双击才能点击到label
<label for="fid">美化元素</label>
<input type="file" id="fid" >
以上的代码依然不能实现,至少我遇到的IOS是这样的
所以最后的解决方案是
<div class="box" style="position: retative;">
<input type="file" style="position: absolute; left: 0; top: 0; width: 100%; height: 100%; opcity:0" />
<div>美化元素</div>
</div>
把透明度设置为0也可以点击到input;
以上的代码可以在IOS下以及其他浏览器和微信中可以调用相册;
但是,在安卓下是调用不了相册,这个需要安卓的同学去做兼容;
具体咋做得问安卓的同学;