开发者

Call function when click on a link

开发者 https://www.devze.com 2023-03-18 12:35 出处:网络
In my iPhone application, i use web view to display formatted text like this : Tél : 0442059840 The number 0442059840 is a link : <a href=\"\">0442059840</a>.

In my iPhone application, i use web view to display formatted text like this :

Tél :
0442059840

The number 0442059840 is a link : <a href="">0442059840</a>. 开发者_C百科In my case, i want to make a telephone call when i click on that link, is that possible? Thanx in advance.


Just make the href parameter point to the phone number:

<a href="tel://0442059840">0442059840</a>

You can also let the web view parse for links by setting the data detector types. In that case you just need the phone number, and not the <a></a> tag.

0

精彩评论

暂无评论...
验证码 换一张
取 消