Nativescript: Feature request: ClickableSpan support for iOS and Android

Created on 20 Feb 2017  路  4Comments  路  Source: NativeScript/NativeScript

Ability to use clickable Spans in a NativeScirpt project.

At the moment as workaround it could be used ClickableSpan for Android and NSLinkAttribute for iOS. For NativeScript TypeScirpt or NativeScript Angular 2 project we should also install tns-platform-declarations with npm install tns-platform-declarations --save and to follow the setup instructions here.

For iOS we should also implement textViewShouldInteractWithURLInRange delegate method, which will be fired, when some of the clickable text parts have been selected.

An example could be found here.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

feature help wanted android ios low

All 4 comments

@tsonevn Is there anyway to get this working as a Label and not a Text View? Having trouble styling the font of the TextView, the font size won't increase

Hi @BMwanza,
For Android, the approach for setting up a clickable span will work in the same way while using a Label. For iOS, you can set up the attributed text to the Label, however, you should implement different event listener for handling the tap event. Check out this thread in StackOverflow

Does anyone does it work in the 2019? I have to admit the sample is quite challenge to get into, "nativescript" and "angular" is new to me.

Any news?

Was this page helpful?
0 / 5 - 0 ratings