【问题标题】:QML Rich Text color formatting not workingQML富文本颜色格式不起作用
【发布时间】:2016-12-16 21:35:19
【问题描述】:

富文本规范的颜色标签似乎在我的 QML 中不起作用。这是我的代码:

Text {
                id: messageText
                x: /*tagText.width +*/ 4
                width: logItem.width - 8//- tagText.width
                text: "<color=#FFFF0000>[RED TEXT]</color>white text"
                color: "#ccc"
                wrapMode: Text.WrapAnywhere
                textFormat: Text.RichText
            }

文本未正确着色。只有 Text 对象的颜色属性受到尊重。我尝试删除它,但仍然遇到同样的问题。

【问题讨论】:

    标签: user-interface qml richtext


    【解决方案1】:

    标签使用错误。这是正确的方法:

    text: "<font color=\"#FF0000\">[RED TEXT]</font>white text"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-01-10
      • 2012-10-28
      • 2012-08-18
      • 2018-02-09
      • 2017-04-10
      • 2021-10-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多