qml里Text不能显示多行文本问题

it2026-01-01  1

问题: 按网上说的属性配置,但是一直只能显示单行,配置如下:

Text{ id: text1 height: 400 font.pixelSize: 65 text: "Note that some multicast addresses may be reserved"; width: 500 lineHeight: 65 color: "black" wrapMode: Text.WrapAnywhere elide: Text.ElideNone maximumLineCount:2 }

原因: 定位了半天,原来和lineHeight属性有关,删除改属性后,显示为多行文本。

最新回复(0)