iphone - UIWebView,启用触摸保存图像,就像在移动 Safari 中一样

标签 iphone ios image uiwebview

当用户在我的应用程序的 UIWebView 中按住图像时,我想启用保存图像和复制。是否有一个属性可以启用此功能,或者我是否需要编写一些特殊方法来完成此操作?

感谢阅读!

最佳答案

UIImage * downloadImage = [[UIImage alloc] initWithContentsOfFile:path];
    UIImageWriteToSavedPhotosAlbum(downloadImage,nil, nil, nil);
    [downloadImage release];

    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Saved" message:@"Wallpaper saved to your Gallery." delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];

    [alert show];
    [alert release];

Add this whole code to your long press method, it will save your image in gallery.

关于iphone - UIWebView,启用触摸保存图像,就像在移动 Safari 中一样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12912617/

相关文章:

iphone - 我的 iPhone 的 Entitlement.plist 无效?

ios - Apple Developer Account 100 台设备的限制已结束?

c# - 正在保存 jpeg - 该进程无法访问该文件,因为它正被另一个进程使用?

ios - block 中的弱指针为零

javascript - Iphone:点击/单击 "Go"按钮后虚拟键盘不会隐藏

iphone - 从 iPhone 打开 Google map 并显示路线

ios - Shell脚本调用错误命令/bin/sh失败,在Xcode 9中退出代码为1

ios - 在没有 Roximity SDK 的情况下检测 Roximity iBeacon?

ajax - 人们从哪里获得旋转加载图像?

image - 文档 : missing images when using include directives (rst, 狮身人面像)