<i id='iJeVa'><tr id='iJeVa'><dt id='iJeVa'><q id='iJeVa'><span id='iJeVa'><b id='iJeVa'><form id='iJeVa'><ins id='iJeVa'></ins><ul id='iJeVa'></ul><sub id='iJeVa'></sub></form><legend id='iJeVa'></legend><bdo id='iJeVa'><pre id='iJeVa'><center id='iJeVa'></center></pre></bdo></b><th id='iJeVa'></th></span></q></dt></tr></i><div id='iJeVa'><tfoot id='iJeVa'></tfoot><dl id='iJeVa'><fieldset id='iJeVa'></fieldset></dl></div>
<legend id='iJeVa'><style id='iJeVa'><dir id='iJeVa'><q id='iJeVa'></q></dir></style></legend>
      • <bdo id='iJeVa'></bdo><ul id='iJeVa'></ul>
      <tfoot id='iJeVa'></tfoot>

      <small id='iJeVa'></small><noframes id='iJeVa'>

      1. 在 Android 主屏幕小部件中使用 SpannableString?

        时间:2023-09-09
            <tbody id='xIXEy'></tbody>
                <bdo id='xIXEy'></bdo><ul id='xIXEy'></ul>

                <tfoot id='xIXEy'></tfoot>
                <legend id='xIXEy'><style id='xIXEy'><dir id='xIXEy'><q id='xIXEy'></q></dir></style></legend>

              • <small id='xIXEy'></small><noframes id='xIXEy'>

                  <i id='xIXEy'><tr id='xIXEy'><dt id='xIXEy'><q id='xIXEy'><span id='xIXEy'><b id='xIXEy'><form id='xIXEy'><ins id='xIXEy'></ins><ul id='xIXEy'></ul><sub id='xIXEy'></sub></form><legend id='xIXEy'></legend><bdo id='xIXEy'><pre id='xIXEy'><center id='xIXEy'></center></pre></bdo></b><th id='xIXEy'></th></span></q></dt></tr></i><div id='xIXEy'><tfoot id='xIXEy'></tfoot><dl id='xIXEy'><fieldset id='xIXEy'></fieldset></dl></div>
                • 本文介绍了在 Android 主屏幕小部件中使用 SpannableString?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我可以在小部件的 textView 中使用 SpannableStrings 吗?我试过了,它呈现的只是纯文本.我不知道这是我做错了什么(很可能),还是由于某种原因不可能.

                  Can I use SpannableStrings in a widget's textView? I tried and all it rendered was plain text. I don't know if it is something I'm doing wrong (most likely), or if it just isn't possible for some reason.

                  这是我正在使用的代码(真的没什么特别的......)

                  Here's the code I'm using (nothing special really...)

                   public static void updateWidgetState(Context paramContext, String paramString, Integer appWidgetId) {
                  
                      SpannableString majorLabel = new SpannableString("");
                      SpannableString minorLabel = new SpannableString("");
                      if (position > -1) {
                          majorLabel = GetParsedMajorLabel(paramContext);
                          minorLabel = GetParsedMinorLabel(paramContext);
                      }
                      RemoteViews localRemoteViews = buildUpdate(paramContext, paramString, appWidgetId);
                      localRemoteViews.setTextViewText(R.id.majorlabel, majorLabel);
                      localRemoteViews.setTextViewText(R.id.minorlabel, minorLabel);
                   }
                  

                  推荐答案

                  如果您想在 TextView 中显示格式化文本,请使用 fromHtml

                  If you would like to display formatted text in a TextView, use fromHtml

                  这篇关于在 Android 主屏幕小部件中使用 SpannableString?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:每个 notifyAppWidgetViewDataChanged() 仅调用一次 RemoteViewFactory 下一篇:该类型的方法 startActivity(Intent) 未定义?

                  相关文章

                    <bdo id='tw36h'></bdo><ul id='tw36h'></ul>
                • <small id='tw36h'></small><noframes id='tw36h'>

                  <i id='tw36h'><tr id='tw36h'><dt id='tw36h'><q id='tw36h'><span id='tw36h'><b id='tw36h'><form id='tw36h'><ins id='tw36h'></ins><ul id='tw36h'></ul><sub id='tw36h'></sub></form><legend id='tw36h'></legend><bdo id='tw36h'><pre id='tw36h'><center id='tw36h'></center></pre></bdo></b><th id='tw36h'></th></span></q></dt></tr></i><div id='tw36h'><tfoot id='tw36h'></tfoot><dl id='tw36h'><fieldset id='tw36h'></fieldset></dl></div>
                  <tfoot id='tw36h'></tfoot>

                  1. <legend id='tw36h'><style id='tw36h'><dir id='tw36h'><q id='tw36h'></q></dir></style></legend>