mailto: link in UIWebView - Does Not work

前端 未结 4 1626
猫巷女王i
猫巷女王i 2021-02-12 12:37

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

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-12 13:01

    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:

    myWebView.dataDetectorTypes = UIDataDetectorTypeAll; //or UIDataDetectorTypeAddress etc..
    

    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!

提交回复
热议问题