2017-02-12 75 views
0

我有一個抽屜,它的一個按鈕,其中包括關閉抽屜。當我按下按鈕時,按下的動畫開始,當它被點擊時,抽屜關閉,然後動畫(按下的動畫)停止,所以當我再次打開時,抽屜按鈕被部分突出顯示。如何才能讓它繼續動畫?按下按鈕(波紋)動畫按鈕停止

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 
     } 
    } 
} 
+0

我無法重現這一點。你能列出你重現它的確切步驟嗎?一個GIF也會很好(如果你在Windows上,你可以免費使用[LICEcap](http://www.cockos.com/licecap/))或截圖。 – Mitch

+0

我不使用AVD,因爲所有x86 AVD設備都不能運行qml應用程序,因爲存在opengl鏈接問題。 我實際上通過更改Button.qml(在qt文件夾安裝中)解決了漣漪動畫的問題。在Ripple元素中,我將'control.Material.rippleColor'改爲'「transparent」'。 –

+0

你能回答這個問題,然後接受它,所以我們知道它已經解決了嗎? – Mitch

回答

0

我實際上通過更改Button.qml(在qt文件夾安裝中)解決了漣漪動畫的問題。在Ripple元素中,我更改control.Material.rippleColor"transparent"