我想在安卓系统中的ListView和ImageVIew之间制作一个轮转的3D动画,有没有什么库或示例代码?我是一个新的Android开发新手,所以我不知道如何动画这样的东西。
发布于 2016-12-25 04:04:51
这个库可能会对您有所帮助:https://github.com/nipun-birla/Swipe3DRotateView
如usage中所述
在您的build.gradle(应用程序)中添加依赖项
dependencies {
    compile 'com.github.nipun-birla:Swipe3DRotateView:0.0.1'
}根据需要将Swipe3DRotateView放入布局中:
<com.nipunbirla.swipe3drotateview.Swipe3DRotateView
    android:id="@+id/rotateView"
    android:layout_height="match_parent"
    android:layout_width="match_parent">
    //Put the backview as first child
    <FrameLayout
        android:layout_width="300dp"
        android:layout_height="300dp"
        android:layout_gravity="center"
        android:background="#934567">
    </FrameLayout>
    //Put the frontview as second child
    <FrameLayout
        android:layout_gravity="center"
        android:layout_width="300dp"
        android:layout_height="300dp"
        android:background="#134567">
    </FrameLayout>
</com.nipunbirla.swipe3drotateview.Swipe3DRotateView>在活动中查找视图,如下所示:
Swipe3DRotateView swipe3DRotateView = findViewById(R.id.rotateView);要设置是否允许X旋转,请执行以下操作:
swipe3DRotateView.setIsXRotationAllowed(true);要设置是否允许Y旋转:
swipe3DRotateView.setIsYRotationAllowed(true);要检查是否允许X旋转,请执行以下操作:
boolean isXAllowed = swipe3DRotateView.isXRotationAllowed();要检查是否允许Y旋转,请执行以下操作:
boolean isYAllowed = swipe3DRotateView.isYRotationAllowed();设置动画时长,默认值为1000毫秒
swipe3DRotateView.setAnimationDuration(1000);要预先在视图上设置动画侦听器,请使用:
swipe3DRotateView.setHalfAnimationCompleteListener(halfListener);要在后面的视图上设置动画侦听器,请使用:
swipe3DRotateView.setCompleteAnimationCompleteListener(fullListener);https://stackoverflow.com/questions/37834965
复制相似问题