In the Html class, Android has:
public static Spanned fromHtml (String source)
which according to the documentation :
Returns the displayed stylized text from the provided HTML string.
.. and combining this with:
public void setText (CharSequence text, TextView.BufferType type)
which according to the documentation of TextView :
Sets the text displayed by this TextView (see setText (CharSequence)), and also sets whether it is stored in a custom / spun buffer and whether it is available.
.. allows you to display a line with HTML markup in a TextView (example from https://stackoverflow.com/a/3/9856/ ... ):
String styledText = "This is <font color='red'>simple</font>."; textView.setText(Html.fromHtml(styledText), TextView.BufferType.SPANNABLE);
My question is what is equivalent to this in iOS?
I did some research and it seems that people are recommending using UIWebView for this purpose - but is this really the only solution? And is this a recommended solution?
Thanks.
source share