安卓在ios的一些适配小问题记录

问题一:安卓fixed在ios上不兼容处理(主要是position,换完之后间距需要做一些小修改)

 

问题二:new Date(YYYY-MM-DD HH:mm:ss).getTime()在ios上不兼容

time.replace(/\-/g, "/")

问题三:ios端元素监听touch长按事件会触发元素的click事件,这里记录ios端的处理方法(应用场景:聊天列表置顶,点击列表项进入聊天页面)

 //定义两变量
 timer: null, //定时器
 longpress: false //是否长按
<div @touchstart="touchStart" @touchmove="touchMove" @touchend="touchEnd"></div>
 touchStart() {
     let that = this;
     if (isiOS) {
       clearTimeout(that.timer);
       that.timer = setTimeout(() => {
       that.longpress = true;
       //ToDo 长按事件(判断长按时长1s)
       }, 1000)
     }
  },
  touchMove() {
     console.log('move')
     clearTimeout(this.timer);
     this.longpress = true;
  },
  touchEnd(userId, userName, image) {
     console.log('end')
     clearTimeout(this.timer);
     if (this.longpress == false) {
      //不是长按,定义为点击事件
     } else {
       this.longpress = false;
     }
   },

问题四:input在ios上聚焦l弹出键盘,但是无法输入内容

input{
    -webkit-user-select: text;
    -user-select: text;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值