当用户在我的应用程序的 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/