Is there anyway to display a image in a UIWebview from the iphone photo storage
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Do all browsers on iOS use WKWebview or UIWebVIew?
- Can not export audiofiles via “open in:” from Voic
May be this is the suitable code in the upload image,
If you just wanted to display the image, the code below works just fine (using the UIImagePickerDelegate)
hope this helps.
in your image picker delegate, save the file locally, basic code snippet, not complete
the in your webview, set the base path of the HTML page you are going to load to the same path used for saving the image file.
Yes, you first must use the UIImagePickerController. It will cause a new window from the iPhone to appear and the user will be requested to pick a photo.
When they pick the photo, you can get access to this photo, you can either dismiss the picker or the user can continue picking photos.
You are not allowed direct access to users photos and wont be able to access their photos with asking the user first. This makes total sense, as a user I would not want developers sneaking into my photo library and uploading my photos in the background.
To add these to a UIWebView, you will nee to set the [UIWebView basePath] to your (document directory where you saved the photo from the above process), I have got this working, search stackoverflow for UIWebView Basepath, or check documentation.
Cheers, John.