如何在我想要的时刻运行打开抽屉的动画? 我使用 SupportLibrary v7 使用“汉堡包”动画。 想写这样的方法:
class Activity extends ActionBarActivity{
ToolBar toolbar;
ActionBarDrawerToggle toogle;
...
private void setToolBarIconState(State state) {
if (state == State.menu) {
//flipIconToMenu ?
} else {
//flipIconToBackPointer ?
}
}
最佳答案
要实现它,您需要使用 Canvas 。
如果您想要教程,请点击以下链接:
https://github.com/neokree/MaterialNavigationDrawer
https://github.com/balysv/material-menu
https://github.com/ikimuhendis/LDrawer
https://github.com/HeinrichReimer/material-drawer
https://github.com/kanytu/android-material-drawer-template
https://github.com/Zlate87/material-navigation-drawer-example
https://github.com/Zlate87/material-navigation-drawer-example
关于Android以编程方式做工具栏图标动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29196962/