Selectable Label on Xamarin.Forms

Enrique Ramos Vargas
1 min readNov 24, 2018

--

The Xamarin.Forms Label doesn’t have something as basic as being able to select text, so we are going to implement it using ViewRenderer: UITextView in iOS and TextView in Android.

iOS behavior:

Android behavior:

Here you can see the iOS Renderer using UITextview

Here you can see the Android Renderer using Textview:

Finally this is the custom control with some properties that we are going to use in our pages:

You can see the complete Renderers code and the use of SelectableLabel control in this Github repository.

If you need a better understanding of the native properties that make the text selectable, I recommend reading this post by Anna.

I hope this has been helpful for someone :)

--

--