Android的按钮文本和HTML按钮、Android、HTML、文本和

2023-09-05 01:58:36 作者:沒結果的故事最美╮

我如何使用 HTML 在Android窗口小部件按钮?

how do I use html in an android widget Button?

推荐答案

您应该可以使用 Html.fromHtml()来原始的HTML转换成跨区的对象,你可以在你的按钮的setText()通话使用。由于 HTML 文档状态,不是所有的HTML标签都支持。

You should be able to use Html.fromHtml() to convert raw HTML into a Spanned object that you can use in a setText() call on your button. As the Html documentation states, "Not all HTML tags are supported".