QtQuick 左右滑动页面

 1 import QtQuick 2.11
 2 import QtQml.Models 2.11
 3 
 4 
 5 Rectangle{
 6     width: 500
 7     height: 500
 8 
 9     ListView{
10         id : listview
11 
12         anchors.fill: parent
13         focus: false // 如果为真 接受键盘的左右键的导向
14 15 
16         orientation: ListView.Horizontal //横向滑动
17         boundsBehavior: Flickable.StopAtBounds    //滑动到边界就停止
18         snapMode: ListView.SnapOneItem    //滑动后调整显示一个完整的,移动一页一页地
19 
20 
21         highlightRangeMode: ListView.StrictlyEnforceRange
22         highlightMoveDuration: 250
23 
24         model:ObjectModel{//不需要delegate 的配合
25             Rectangle{//第一个页面显示
26                 width: 500
27                 height: 500
28 
29                 color: "blue"
30             }
31 
32             Rectangle{//第二个页面显示
33                 width: 300
34                 height: 300
35 
36                 color: "green"
37             }
38         }
39 
40 
41 //        delegate:
42     }
43 }

 

转载于:https://www.cnblogs.com/mrAAron/p/9963579.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值