在QML,Blackberry的屏幕上运行文本

时间:2013-12-03 17:25:29

标签: blackberry qml blackberry-10

我在Blackberry Native中遇到了问题。文本ID是一个QString,它包含很多单词,我不知道如何对它进行编码,使得文本不会在屏幕上运行。我试过LabelTextFitMode,它不起作用。有任何想法吗?

    Label { 
            text: "Description:"
            textStyle.fontWeight: FontWeight.Normal
            textStyle.fontSize: FontSize.Small
            textStyle.color: Color.DarkRed // Show this text
        } 
        Label {
            id: description // Name this as type_label so that the property alias above can set the text property of this item
            //textStyle.fontSize: FontSize.Small
            textFit {
                mode: LabelTextFitMode.FitToBounds
            }


        }        

1 个答案:

答案 0 :(得分:1)

只需使用这样的多行:

Label {
   id: description 
   multiline: true
}