Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

how to update button text on android

$
0
0

Hi
I am trying to write a custom button control where I can render formatted text on a button. On iOS that was pretty straight forward on Android I am struggling as the update of the Button text does not seem to be rendered. I am doing it just like it works on the iOS side with a custom property:

        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
                case "FormattedText":

                    var mButton = customButton;
                    var attrString = mButton.FormattedText.ToAttributed(default(Font), default(Color), null);
                    Control.SetText(attrString, TextView.BufferType.Spannable);
                    //default:
                    break;
            }
            base.OnElementPropertyChanged(sender, e);

        }

thanks for your help

Joe


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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