我对Qt很陌生,我下载了V5.7和QuickControls2.0,主要用于Android开发,我想知道是否有可能使用一些物质控件,比如滑动导航抽屉和浮动动作按钮,因为它们现在无处不在(比如最近的twitter应用程序)。
谢谢。
发布于 2016-09-16 08:07:29
使用QtQuickControls2.0中的Drawer。我还在寻找一个应用程序抽屉和就是这里。
为了帮助你,我做了一个简单的例子。将其粘贴到您的main.qml中并运行它。
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick 2.7
ApplicationWindow {
id: window
width: 480
height: 640
visible: true
Drawer {
id: drawer
width: window.width/2
height: window.height
Rectangle{
Column{
spacing: 5
Label{
text:"Awesome"
}
Label{
text:"Awesome"
}
Label{
text:"Awesome"
}
Label{
text:"Awesome"
}
}
}
}
Rectangle {
id: rectangle1
color: "#ffffff"
anchors.fill: parent
anchors.centerIn: parent
Label{
id:label
text:"Yeah Label is awesome"
}
Rectangle{
id: rectangle
anchors.centerIn: parent
color:"Red"
height: parent.height/2
width: parent.width/2
}
}
}发布于 2016-11-20 23:18:38
QtQuickControl2.1,自从Qt5.8发布以来,有一个名为RoundButton的QML类型,它在材料风格上具有提升效果。它被演示为文本编辑器示例中的浮动操作按钮

https://stackoverflow.com/questions/37774936
复制相似问题