2017-01-16 71 views
0

我正在嘗試使用LayoutAnimation對視圖更改進行動畫處理。 使用此代碼:LayoutAnimation:如何不動畫輸入視圖?

生產:
Video

正如你看到的,「過濾器」菜單中的衰落動畫,我希望它不是淡入(在從開始的不透明度1出現) 。

我試着這樣做:

LayoutAnimation.configureNext({ 
    duration: 200, 
    create: { 
    type: 'easeInEaseOut', 
    }, 
    delete: { 
    type: 'easeInEaseOut', 
    }, 
    update: { 
    type: 'easeInEaseOut', 
    }, 
}); 

但我得到的錯誤:Unsupported layout animation createConfig property (null)LayoutAnimation可以不創建創建視圖的動畫效果嗎?

回答

1

你應該能夠簡單地忽略createdelete鍵:

LayoutAnimation.configureNext({ 
    duration: 200, 
    update: { 
     type: 'easeInEaseOut' 
    } 
    }); 

錯誤Unsupported layout animation createConfig property (null)通過在創建/刪除動畫稱爲property缺少所需的值造成的。

+0

有時,這只是多麼愚蠢。謝謝! – whitep4nther