ColumnLayout&RowLayout和Column与Row
这两对布局有什么差异呢?
而且为什么ColumnLayout实际效果是控制垂直方向布局的(行)。。
并且ColumnLayout或者RowLayout的spacing为何设置了不起作用。。
以上在5.3.1中
delegate:Component {//右侧tabItem
//行布局
ColumnLayout {
width:treeListView.width+5
spacing:5
//每一行中的列布局
RowLayout{
height:parent.height
Rectangle{
id:leftRec
height:35
width:15
color:"red"
}
Rectangle
{
anchors.left: leftRec.right
height:35
Layout.fillWidth: true
color:"#d1cab5"
Text {
text: tab_name
}
MouseArea {
id: mouse_area1
z:1
hoverEnabled: false
anchors.fill: parent
onClicked:
{
ListView.currentIndex = index
console.log(index,treeListView.width)
}
}
}
}
}
}