import QtQuick 2.0
import QtQuick.Controls 1.4
Item
{
width: 800;
height: 800;
Rectangle
{
anchors.verticalCenter: parent.verticalCenter;
anchors.horizontalCenter: parent.horizontalCenter;
width: 600;
height: 600;
color: "gray";
Flickable
{
id: flick;
width: 600;
height: 600;
anchors.horizontalCenter: parent.horizontalCenter;
anchors.verticalCenter: parent.verticalCenter;
contentWidth: image.width;
contentHeight: image.height;
clip: true;
Image
{
id: image;
source: "./images/test1.JPG";
}
}
//添加一个滚动条按钮
Rectangle
{
id: rect;
width: 10;
anchors.right: flick.right;
color: "#6D665C";
//flick.visibleArea.heightRatio = flick.h
给QML中的Flickable添加滚动条
最新推荐文章于 2024-04-15 22:54:52 发布