简体   繁体   English

控制导航抽屉的滑动速度

[英]Controlling the Navigation Drawer sliding speed

I spent a fair amount of time searching the web for some general guidance on which methods or interfaces can I use in order to control the speed with which the Navigation Drawer slides either open or closed , I don't want to use ActionBarToggle . 我花了相当长时间在网络上搜索一些通用指导,以便了解如何使用方法或接口来控制导航抽屉滑动打开或关闭的速度,我不想使用ActionBarToggle

There are some methods like OnDrawerSlide and similar, but there aren't any examples or more information on what those methods exactly do. 有一些方法,例如OnDrawerSlide和类似方法,但没有任何示例或更多信息说明这些方法的确切作用。

Any links or tips will be greatly appreciated.Just as an example I would like to be able to click an Item on the Drawer and then to be able to define how fasts the drawer closes, it can be very smooth and slow. 任何链接或提示都将不胜感激。仅作为示例,我希望能够单击抽屉上的某个项目,然后能够定义抽屉关闭的速度,它可以非常平稳且缓慢。

I think this link will help you: Speed up 'Navigation Drawer' animation speed on closing? 我认为此链接将为您提供帮助: 在关闭时加快“导航抽屉”动画的速度?

public boolean smoothSlideViewTo(... int duration) {
    ...
    return forceSettleCapturedViewAt(... int duration);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM