【问题标题】:Pressed (ripple) animation on button stops按钮停止上的按下(波纹)动画
【发布时间】:2017-02-12 17:53:16
【问题描述】:

我有一个抽屉,里面有一个按钮,其中包括关闭抽屉。当我按下按钮时,按下的动画开始,当它被点击时抽屉关闭,然后动画(按下的动画)停止,所以当我再次打开抽屉按钮时部分突出显示。如何让它继续动画?

Drawer {
     id: drawer
     width: 0.66 * parent.width
     height: parent.height

     background: Rectangle {
         color: "#212121"
         anchors.fill: parent
      }

     ColumnLayout {
         Button {
             onClicked: {
                 drawer.close()
             }
             text: "<font color=\"#ffffff\">Lorem</font>"
             implicitHeight: 60
             implicitWidth: drawer.width
             flat: true
             Material.theme: Material.Dark
             Material.elevation: 0
         }
     }
 }

【问题讨论】:

  • 我无法重现这个。你能列出你重现它的确切步骤吗? GIF 也不错(如果您使用的是 Windows,则可以免费使用 LICEcap)或屏幕截图。
  • 我不使用 AVD,因为所有 x86 AVD 设备都无法运行 qml 应用程序,因为存在 opengl 链接问题。我实际上通过更改 Button.qml(在 qt 文件夹安装中)解决了波纹动画的问题。在 Ripple 元素中,我将 control.Material.rippleColor 更改为 "transparent"。
  • 你能回答这个问题然后接受它,这样我们就知道它已经解决了吗?

标签: android qt qml qtquick2 qtquickcontrols2


【解决方案1】:

我实际上通过更改 Button.qml(在 qt 文件夹安装中)解决了波纹动画的问题。在 Ripple 元素中,我将 control.Material.rippleColor 更改为 "transparent"。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-29
    • 1970-01-01
    • 2017-12-22
    • 2020-09-13
    相关资源
    最近更新 更多