iOS Question Need to execute links from my app

chuck3e

Active Member
Licensed User
Longtime User
Erel,
I copied your code from a June 9, 2016 question labeled "Label with link" by Umberto. You suggested using the following code:

Sub Linkify(tv As TextView)
Dim no As NativeObject = tv
no.SetField("editable", False)
no.SetField("dataDetectorTypes", 0xffffffff)
End Sub

I modified it to use with a view that I created with Designer:

Dim no As NativeObject = TextViewiS
no.SetField("editable", False)
no.SetField("dataDetectorTypes", 0xffffffff)

You indicated the text would be a link and un-editable.

I typed a url into the textview's Text in Designer but, when I run my app, it displays as an editable text not an un-editable link.

Did I misunderstand? Should this still work? Is there now a better way to do this?

My goal is to have the user tap a button the takes them to a screen with a list of executable links.
 

chuck3e

Active Member
Licensed User
Longtime User
Semen, thanks. I am able to convert text to a url in TextviewiS.text using your suggestion (the link text turns blue) and can click on the link and see that it does go to Sub TextViewiS_LinkClick, but it doesn't bring up the website. Is there another step I'm missing?
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
As I understand, a TextView is not a web browser. It can inform only.

I'd recommend to use WebView. It's very easy to create HTML page with links (<a href= ...) and to load it using LoadHtml.
 
Upvote 0

chuck3e

Active Member
Licensed User
Longtime User
Are there any code examples or videos or docs that show how to browse a website from inside an app?
 
Upvote 0
Top