Flickable
のために、ある種の視覚的な「エッジに対してバウンス」効果を作りたいと思います。しかし、エッジは壁のような硬いエッジなので、いつでもコンテンツをドラッグまたはフリックすることはできません。Qt QML。どのように内容がエッジに対して跳ねるが、それを超えないFlickableを持つか?
私はStopAtBounds
を設定していますが、次にリバウンドトランジションを使用できないコードがあります。
import QtQuick 2.7
import QtQuick.Controls 1.4
ApplicationWindow
{
visible: true
width: 800
height: 800
Flickable
{
anchors.fill: parent
contentWidth: bob.width
contentHeight: bob.height
rightMargin: 200
leftMargin: 200
topMargin: 200
bottomMargin: 200
// prevents bob from going outside of bounds,
// but now cant use `rebound` transition.
// so how to apply `Easing.OutBounce`
boundsBehavior: Flickable.StopAtBounds
Rectangle
{
id: bob
width: 600
height: 600
color: "red"
}
}
}
あなたは赤い四角をフリックすることができますし、それが壁に当たったが、それはバウンスしません。
提案がありますか?
「Flickable」は、そのようなタイプの動作に対しては行われず、カスタム動作もサポートされません。 –
まだありません:https://bugreports.qt.io/browse/QTBUG-38515 – GrecKo