Is the areanything special you need in html or Callbacks in a UIWebView to handle anchor tags with an href, or is there something special about an anchor tag with a mailto link in the href?
相关问题
- 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
- Removing the href attribute
- Can not export audiofiles via “open in:” from Voic
I noticed that when running in the iPhone simulator, I could click on an HTTP link in my UIWebView and it would open in Safari, but when I clicked on a mailto link nothing would happen. But when I deployed the app to a real device, it worked. I expect the reason is because there is no mail app on the simulator, but there is Safari.
In your UIWebView's delegate, do:
Working example for Swift 4: 3 cases are treated, expand as needed.
open all other URLs in mobile safari
I wanted to note that this is probably not the best solution.
UIWebView does have a property called dataDetectorTypes - setting this to all or address should solve your problem without overriding the Method mentioned above:
But be aware that this might not work on the simulator - I tried it with the iPad 6.0 Simulator where it's not working although on an iPad Device it's working like a charm!