进出动漫发行的Andr​​oid幻灯片 [英] Android Slide in and out animation issue

查看:148
本文介绍了进出动漫发行的Andr​​oid幻灯片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的活动成功的Andr​​oid 4.1的活动幻灯片使用动画为B

My Activity Successfully slide in android 4.1 from Activity A to B using animation

**inamation.xml**

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="100%"
android:toXDelta="0%"
android:duration="600" />
</set>

outanimation.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="100%"
android:toXDelta="0%"
android:duration="600" />
</set>

和活性的我用overidding未决的过渡,如下图所示:

and in activity A i used overidding pending transition as shown below:

A.this.overridePendingTransition(R.anim.outanimation,R.anim.inanimation);

A.this.overridePendingTransition(R.anim.outanimation,R.anim.inanimation);

由于前面说的这个正常工作的安卓4.0及以上平台,但是当我 在Android 2.3平台上测试了一下,活动A到B获取Android的默认行为的动画。

as said earlier this works fine on android 4 and above platform but when i test it on android 2.3 platform, Activity A to B gets android default activity animation.

我怎么能运行我的活动滑动从左到右,从右到左是2.2及以上版本兼容。

how can i run my activity to slide left to right and right to left which is compatible with 2.2 and above.

有没有办法通过编程设置两个活动之间的动画?

更新

的问题是,该装置,至少在三星Galaxy的情况下,必须启用这个工作动画。这可以在设置菜单来完成。

The problem was that the device, at least in the case of Samsung Galaxy, has to have animations enabled for this to work. This can be done in the settings menu.

你知道如何激活的设置菜单上的所有动画的Andr​​oid?

推荐答案

有关Android的幻灯片和退出动画,我有以下使用code。

For Android Slide in and out animation, I have use following code.

活动答:

Intent intnt = new Intent(SplashScreen.this,
                        CustomTabActivity.class);
                startActivity(intnt);
                overridePendingTransition(R.anim.slide_in_left,
                        R.anim.slide_out_left);
                finish();

slide_in_left.xml

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="@android:integer/config_longAnimTime"
    android:fromXDelta="100%p"
    android:toXDelta="0%p" />

slide_out_left.xml

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="@android:integer/config_longAnimTime"
    android:fromXDelta="0"
    android:toXDelta="-100%p" />

这篇关于进出动漫发行的Andr​​oid幻灯片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆