Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Xamarin Forms Custom View Renderer for TextView SetTextIsSelectable issue

$
0
0

I have an issue with SetTextIsSelectable.I did make SetTextIsSelectable(true).This time,GestureRecognizers of label isn't working in xamarin forms.
Below code in xamarin andorid :

 protected  override void OnElementChanged(ElementChangedEventArgs<SelectableLabel> e)
        {
            base.OnElementChanged(e);

            var label = (SelectableLabel)Element;
            if (label == null)
                 return;

            if (Control == null)
            {
                textView = new TextView(this.Context);
            }

            // Initial properties Set
            textView.Text = label.Text;
            textView.SetTextColor(label.TextColor.ToAndroid());
            textView.Click += TextView_Click;
            textView.SetTextIsSelectable(true);

             SetNativeControl(textView);
        }

Below code in xamarin forms :

    var tgr = new TapGestureRecognizer();
    tgr.Tapped += Tgr_Tapped1;
    mylabel.GestureRecognizers.Add(tgr);

Viewing all articles
Browse latest Browse all 204402


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>