简体   繁体   English

如何在Android中实现带有动画效果的滑动菜单以实现活动

[英]How to implement sliding menu with animation effect for activity in android

I have checked this sliding menu library https://github.com/jfeinstein10/SlidingMenu they have used fragment and I have checked the navigation drawer. 我已经检查了这个滑动菜单库https://github.com/jfeinstein10/SlidingMenu他们使用了片段,并且我已经检查了导航抽屉。 It doesn't have an animation effect. 它没有动画效果。 I want to implement a sliding menu with an animation effect for an activity instead of fragment. 我想为活动而不是片段实现带有动画效果的滑动菜单。

Can anybody tell me what is the best way to implement this? 谁能告诉我实现此目标的最佳方法是什么?

Any help would be highly appreciated 任何帮助将不胜感激

Thanks 谢谢

You can use translate plus scale animation and apply this to your parent layout of activity. 您可以使用平移加比例缩放动画并将其应用于活动的父级布局。

for example: 例如:

<set xmlns:android="http://schemas.android.com/apk/res/android" >
    <translate
        android:duration="400"
        android:startOffset="0"
        android:interpolator="@android:anim/accelerate_decelerate_interpolator"
        android:fromXDelta="+80%p"
        android:toXDelta="0" />
</set>

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

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