QML-SwipeView

    SwipeView {
        id: swipeView
        z:0;
        width: parent.width-listView.width;
        height: parent.height;
        anchors.left: listView.right;
        interactive: false;//禁止手拖动
        currentIndex: listView.currentIndex;
        Component.onCompleted:{
            contentItem.highlightMoveDuration = 0;       //将移动时间设为0
        }
        //树1
        Tree_1 {

        }

        //树2
        Tree_2 {

        }
    }

注意:SwipeView的index变化时候,如从1切换到2,1并不会消失,而是从当前屏幕左移或者右移动,并且可能会覆盖到其他控件上,可以通过设置clip: true;

posted @ 2020-08-07 11:40  朱小勇  阅读(1744)  评论(0编辑  收藏  举报