显示页面从底部到顶部 [英] Display page From Bottom to Top

查看:193
本文介绍了显示页面从底部到顶部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从底部显示一个活动到另一个顶部使用意向的动画。

I want to display one activity to another from bottom to top animation using Intent.

给我一些示例为。

像下面

Intent i2 = new Intent(main.this, test.class);
startActivity(i2);

动画底部到顶部。

with animation bottom to top.

推荐答案

定义在RES /动画/ slide_in_up.xml动画:

Define an animation in res/anim/slide_in_up.xml:

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

和另一个位于RES /动画/ slide_out_up.xml:

and another at res/anim/slide_out_up.xml:

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

然后将这些之后调用startActivity:

Then apply these after to call startActivity:

Intent i2 = new Intent(main.this, test.class);
startActivity(i2);
overridePendingTransition( R.anim.slide_in_up, R.anim.slide_out_up );

有介绍这里这可以帮助你进一步的Andr​​oid动画

There an introduction to Android animation here which may help you further.

这篇关于显示页面从底部到顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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