4

解决Ionic在iOS中无法长按保存图片的问题

 3 years ago
source link: https://www.wikimoe.com/?post=259
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
72551535690738.jpg

解决Ionic在iOS中无法长按保存图片的问题

作者:广树 | 时间:2021-5-23 16:52:59 | 分类 : JavaScript/jQuery/Vue

先说答案:

在需要长按保存的图片中增加一段样式

  1. -webkit-touch-callout: default !important;

原理:

这是一段苹果Safari专用的样式,用途就是禁止图片的长按保存。估计Ionic的UI策略本来是也想禁止掉安卓的长按保存,但是安卓似乎没有对应的方案,就唯独给苹果设置上了...因为自己用的是安卓的手机,项目是明确要求长按保存的,结果一直没有发现这个问题,属实坑。而且官方文档也没有写出来。官方论坛倒是在15年和17年的时候有人发帖问如何解决以及这个设计的意图是什么,结果无人问津...

标签: Ionic
捐赠

发表评论:

个人昵称

邮件地址 (选填)

个人主页 (选填)

OωO表情

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK