QML ScrollView with ColumnLayout

后端 未结 2 371
你的背包
你的背包 2021-01-12 02:30

I am trying to create a scroll view around a ColumnLayout, unfortunately my current code doesn\'t work. I know about ListView, but in my case I need to create scrollable Lay

2条回答
  •  一向
    一向 (楼主)
    2021-01-12 03:02

    Same problem on my side. This worked for me :

    ScrollView {
        width: parent.width
        height : parent.height
        contentWidth: column.width    // The important part
        contentHeight: column.height  // Same
        clip : true                   // Prevent drawing column outside the scrollview borders
    
        Column {
            id: column
            width: parent.width
    
            // Your items here
        }
    }
    

提交回复
热议问题