ios和安卓的兼容问题(不定期更新)

1. ios渐变色linear-gradient中使用的透明色transparent会发灰

  ios对background: linear-gradient(to right, transparent, #fff 32%)这个透明渐变色会发灰,改成background: linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 32%)即可

2. ios对position:fixed会出现页面抖动的情况,上下拉动滚动条时卡顿、慢

  如下布局可以解决

<header></header>//头部置顶
<div></div> //中间滚动
<footer></footer>//底部置底
header{
position:fixed;
top:0;
}

div{
 position: absolute;
 width: 100%;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 overflow-y: scroll;
 -webkit-overflow-scrolling: touch;/* 解决ios滑动不流畅问题 */      
}

footer{
position:fixed;
bottom:0;
}

 3. ios对xxxx-xx-xx格式的时间格式不支持,可支持xxxx/xx/xx格式

  通过time.replace(/-/g,'/'),可以全局替换时间的-为/,可解决

  或者用dayjs 或者moment的时间插件库

4.  ios的input框,会有灰色阴影问题,添加下面样式即可

input{
    -webkit-appearance: none;
}

5. ios对一些非点击元素(如span,lable),添加click事件的时候,会出现不触发的情况,css新增cursor:pointer;即可

6. 不论你是用ui组件的弹框还是手写的,ios手机弹窗蒙层置灰覆盖到他的最大父级,但是安卓就可以覆盖100%全部

解决办法就是弹窗最好放到body或者当前页面父级下面  其他的组件可以平级或者子级,但是不能比弹窗大,否则ios手机就会出现下图的情况

 

 7. 大部分ios手机上传视频会在上传的时候自动转为mov格式的,即使上传的是MP4格式的视频,解决方案就是上传改成支持mov格式的

  


posted @ 2020-12-08 16:00  吼吼酱  阅读(696)  评论(2编辑  收藏  举报