我有一個UIWebView,其中包含Web鏈接。該測試正在從數據庫中顯示。UIWebview未檢測到鏈接
對於文本中的某些鏈接,UIWebView會檢測鏈接,而對於某些鏈接則不會。在數據庫中,所有鏈接都以相同的格式寫入,在空格之後,我有鏈接。請幫助我,爲什麼一些鏈接工作,而不是?
在此先感謝。
NSString *newString =[NSString stringWithFormat:@"<html><script> document.ontouchmove = function(event) { if (document.body.scrollHeight == document.body.clientHeight) event.preventDefault(); } </script><script type='text/javascript'>function myFunction() { window.open('http://www.otherlink.com');} function myFunction1(){window.open('http://www.newlink.com');}</script><style type='text/css'>.layout {padding:6px 10px 12px; width:300px; height:398px} *{padding:0; margin:0;line-height:normal}img{margin-bottom:10px;width:300px} button{padding-bottom:7px; border:none; text-decoration:underline;text-align:right;float:right; font-family:ArnhemPro-Blond; font-size:13px; color:#666666}.headline {color:#000000; font-family:PublicoHeadline-Light; font-size:28px; padding-bottom:4px;}.subHeadLine {color:#585c74; font-family:ApexNew-Book;margin-bottom:10px;font-size:14px;}.fullText {font-size:13px;font-family:ArnhemPro-Blond;margin-bottom:7px;} .fullText p { color:black; font-size:13px; margin-bottom:7px} .fullText a { text-decoration: underline; color: #A6091E; font-weight:bold;} .clr {clear:both;} </style> <body><div class='layout'><p class='headline'>%@</p><p class='subHeadLine'>%@</p><img src='%@'/><p class='fullText'>%@</p><button onclick='myFunction()'>Try it</button><div class ='clr'></div><button onclick='myFunction1()'>Try it Next</button></div></body></html>",headLine,subHeadLine,path,fullText] ;
它顯示文本+圖像+ 2按鈕。
你能告訴我們UIWebview的內容嗎? –
它是HTML字符串,如果您的意思是顯示文本,那麼我將粘貼它,或者您的意思是HTML字符串。 – fibnochi
我們希望看到html字符串。 –