QML之TabBar
来源:互联网 发布:使命召唤 ol命运数据 编辑:程序博客网 时间:2024/06/14 19:30
TabBar的切换效果
import QtQuick 2.0import QtQuick.Window 2.2import QtQuick.Controls 2.0import QtQuick.Layouts 1.3Window{ id:window visible:true width:400 height:400 TabBar{ id:bar; width:parent.width; TabButton{ text:qsTr("Home"); } TabButton{ text:qsTr("Discover"); } TabButton{ text:qsTr("Activity"); } } StackLayout{ width:parent.width; currentIndex:bar.currentIndex; Item{ id:homeTab } Item{ id:discoverTab } Item{ id:activityTab } }}
如果TabBar的宽度超过可用宽度,会自动形成flickable
TabBar{ id:bar width:parent.width Repeater{ model:["First","Second","Third","Fourth","Fifth"] TabButton{ text:modelData; width:Math.max(100,bar.width/5); } }}
flickable形成的效果是:当点击第4个按钮的时候,第1个按钮隐藏一半,第5个按钮露出一半,当点击第5个按钮的时候,第1个按钮隐藏了。
阅读全文
0 0
- QML之TabBar
- QML 实现导航栏 类似于TabBar
- IOS之自定义tabbar
- iOS之tabBar
- 微信小程序之tabbar
- React-Native之TabBar
- QML之使用Loader加载QML组件
- QML之Animation
- QML之可视化元素
- QML之states
- QML之View
- QML之TabWidget
- QML之SearchBox
- QML之表盘
- QML之自定义Button
- QML之TabWidget
- 解读QML之二
- 解读QML之三
- 事件冒泡机制
- 并发操作Sqlite3
- 在ajax交互时出现的缓存的问题如何解决?
- 在学习Mybatis一对一关联查询时遇到的疑问【待解决】
- C++之尽量不要重载&&,||或者,运算符(7)---《More Effective C++》
- QML之TabBar
- JavaWeb技术内幕学习笔记二:java I/O工作机制基础知识
- 隐藏的BUG——SetDisplayMode()
- CodeForces
- python基础学习四——控制结构与异常
- char* char[] 区别
- iOS 键盘框架IQKeyboardManager使用
- 使用js实现读取csv文件内容解析到html页面中
- 菜鸟开始学习汇编--序章