java - 如何制作像这样的自定义导航 View 动画

标签 java android xml animation navigation-drawer

我怎样才能实现导航 View 的动画,就像这个一样?

enter image description here

到目前为止,我认为只有通过编写自定义导航 View 才有可能,问题只是它应该是什么样子。或者还有其他选择吗?

最佳答案

FlowingDrawer是您问题的答案。

将依赖项添加到模块级别的 gradle 中:

dependencies {
    compile 'com.mxn.soul:flowingdrawer-core:1.2.2'
    compile 'com.nineoldandroids:library:2.4.0'
}

在布局 xml 文件中定义菜单

<com.mxn.soul.flowingdrawer_core.LeftDrawerLayout
    android:id="@+id/id_drawerlayout"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="false"/>

enter image description here

关于java - 如何制作像这样的自定义导航 View 动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36944409/

相关文章:

mysql - 用于用户数据库的 XML 还是 MySQL?

xml - Ofbiz:一张表单有两个提交按钮,有两个不同的目标

java - Apache Thrift。生成后方法返回类型已更改

Java 不会读取我的第二个进程

java - 这个对象的动态类型是什么?

android - 如何在布局中显示 firebase 通知消息

android - Retrofit 在错误回调中添加自定义对象。失败时

android - 在 MediaPlayer 中打开内容 ://media/external/[. ..] 需要 READ_EXTERNAL_STORAGE 权限?

java - 如何使用资源 jar 中分解出的 .xsd 文件来指定 JAXB 架构?

java - getChildren().addAll() 上的异常