我是 Qt 新手,我下载了带有 Quick Controls 2.0 的 v 5.7 主要用于 Android 开发,我想知道是否有可能使用一些 Material 控件,例如滑动抽屉导航和 float 操作按钮,因为它们现在无处不在(例如最近 Twitter 应用程序)。
谢谢。
最佳答案
使用 Qt Quick Controls 2.0 中的 Drawer
。我还在寻找应用程序抽屉和 here it is 。
为了帮助你,我做了一个简单的例子。将其粘贴到您的 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
}
}
}
关于qt - 我可以在 Qt 中制作 Material 抽屉导航和 FAB 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37774936/