UbuntuKylin 2013-06-28 01:36 采纳率: 0%
浏览 8242

QML中对Column和Row用anchors设置位置的时候总是出现下面的错误

比如:Column {
id: layout
anchors {
left: parent.left
top: parent.top
}
}
就是类似这样的设置老是报下面相关的错误信息,但是位置设置确实起了作用,想知道为什么会这样,求高人指点,谢谢。

QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column

QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row

  • 写回答

3条回答 默认 最新

  • shatters 2022-03-17 15:44
    关注

    不是说coloum不能用,是说coloum里面的item不要用,因为coloum和row本身就是布局元素,它会自动调整内部的元素位置,再用anchor可能冲突不起作用。比如coloum{ Rectangle { anchor....},Rectangle { anchor....} }

    评论

报告相同问题?