I’m trying to set a Button’s text with Html.FromHtml("some html") in Mono for Android.
In Java this works:
myButton.setText(Html.fromHtml("<small>(sub comment)</small>"));
But in Mono for Android that fails as there is no signature in SetText that accepts the Html.FromHtml span.
Is there another way this is supposed to work?
Html.fromHtml()returnsSpanned, which extendsCharSequencein both Android and MonoDroid. But it appears that the AndroidButtonclass has asetText(CharSequence)method (fromTextView), but the MonoDroidButtondoes not (not fromTextViewanyways).It appears that there are other options that contain a
CharSequencethough, perhaps you could use one of those instead?TextView.SetText(Java.Lang.ICharSequence, TextView.BufferType)TextView.set_TextFormatted(Java.Lang.ICharSequence)button.SetText(span, TextView.BufferType.Spannable);