public void overridePendingTransition (int enterAnim, int exitAnim)

  Call immediately after one of the flavors of startActivity(Intent) or finish() to specify an explicit transition animation to perform next.

As of JELLY_BEAN an alternative to using this with starting activities is to supply the desired animation information through a ActivityOptions

bundle or a related function. This allows you to specify a custom animation even when starting an activity from outside the context of the

current top activity.

1.左右滑动

1.1 右进左出

right_in.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="500"
android:fromXDelta="100.0%p"
android:toXDelta="0.0" />
<alpha
android:duration="500"
android:fromAlpha="0.1"
android:toAlpha="1.0" />
</set>

left_out.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="500"
android:fromXDelta="0.0"
android:toXDelta="-100.0%p" />
<alpha
android:duration="500"
android:fromAlpha="1.0"
android:toAlpha="0.1" />
</set>

1.2左进右出

left_in.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="500"
android:fromXDelta="-100.0%p"
android:toXDelta="0.0" />
<alpha
android:duration="500"
android:fromAlpha="0.1"
android:toAlpha="1.0" />
</set>

right_out.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
android:duration="500"
android:fromXDelta="0.0"
android:toXDelta="100.0%p" />
<alpha
android:duration="500"
android:fromAlpha="1.0"
android:toAlpha="0.1" />
</set>

2.上下滑动也一样

3.关于设置动画值

http://developer.android.com/guide/topics/resources/animation-resource.html#Twee

<translate>

A vertical and/or horizontal motion. Supports the following attributes in any of the following three formats:

values from -100 to 100 ending with "%", indicating a percentage relative to itself;

values from -100 to 100 ending in "%p", indicating a percentage relative to its parent;

a float value with no suffix, indicating an absolute value.

Android 屏幕切换动画的更多相关文章

  1. Android的Activity屏幕切换动画(一)-左右滑动切换

    (国内知名Android开发论坛eoe开发者社区推荐:http://www.eoeandroid.com/) Android的Activity屏幕切换动画(一)-左右滑动切换 在Android开发过程 ...

  2. Android的Activity屏幕切换动画-左右滑动切换

    . --> 在Android开发过程中,经常会碰到Activity之间的切换效果的问题,下面介绍一下如何实现左右滑动的切换效果,首先了解一下Activity切换的实现,从Android2.0开始 ...

  3. UI特效--Android利用ViewFlipper实现屏幕切换动画效果

    .屏幕切换指的是在同一个Activity内屏幕见的切换,最长见的情况就是在一个FrameLayout内有多个页面,比如一个系统设置页面:一个个性化设置页面.2.介绍ViewFilpper类ViewFl ...

  4. Android利用ViewFlipper实现屏幕切换动画效果

    1.屏幕切换指的是在同一个Activity内屏幕见的切换,最长见的情况就是在一个FrameLayout内有多个页面,比如一个系统设置页面:一个个性化设置页面. 2.介绍ViewFilpper类 Vie ...

  5. Android的Activity屏幕切换动画左右滑动切换

    在Android开发过程中,经常会碰到Activity之间的切换效果的问题,下面介绍一下如何实现左右滑动的切换效果,首先了解一下Activity切换的实现,从Android2.0开始在Activity ...

  6. Android Activity 切换动画(非原创)

    在Android开发过程中,经常会碰到Activity之间的切换效果的问题,下面介绍一下如何实现左右滑动的切换效果,首先了解一下Activity切换的实现,从Android2.0开始在Activity ...

  7. Android -- ViewPager切换动画,PageTransformer

    transformPage(View view, float position) view就是滑动中的那个view,position这里是float类型,是当前滑动状态的一个表示,比如当滑动到正全屏时 ...

  8. Android Listview切换动画,扩展到任意view切换之间动画实现

    添加布局如下: <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2010 ...

  9. android 屏幕切换

    1.将Activity固定位竖屏可以在配置文件这么写 <activity android:screenOrientation="portrait"> 横屏显示: < ...

随机推荐

  1. jks & pfk

    keytool and jks keytool Name keytool - Key and Certificate Management Tool Manages a keystore (datab ...

  2. 关于.pyc文件

    Python会在执行.py文件的时候,将.py形式的程序编译成中间式文件(byte-compiled)的.pyc文件,这么做的目的就是为了加快下次执行文件的速度. 所以,在我们运行python文件的时 ...

  3. 个人的Linux实用命令

    Linux下的命令有那么多,我不可能也不想去把每一个都记住,列举一些自己工作中很实用的命令,这些命令或许不是很常用,但是有时候却离不了. 1.网络方面 service iptables start/s ...

  4. linux学习笔记22---命令diff和diff3

    diff 命令是 linux上非常重要的工具,用于比较文件的内容,特别是比较两个版本不同的文件以找到改动的地方.diff在命令行中打印每一个行的改动.最新版本的diff还支持二进制文件.diff程序的 ...

  5. fiddler获取手机请求

    最近由于项目的关系,一直在测试APP,但是比较令人头痛的问题就是,APP的测试没有办法像web的测试那样,可以直接的通过开发工具看到请求和响应,对于一些东西只能去看日志(比较麻烦),偶然间发现了fid ...

  6. MapReduce实战(二)自定义类型排序

    需求: 基于上一道题,我想将结果按照总流量的大小由大到小输出. 思考: 默认mapreduce是对key字符串按照字母进行排序的,而我们想任意排序,只需要把key设成一个类,再对该类写一个compar ...

  7. BT下载原理分析

    版权声明:本文为博主原创文章,未经博主允许不得转载. BitTorrent协议. BT全名为BitTorrent,是一个p2p软件,你在下载download的同时,也在为其他用户提供上传upload, ...

  8. C0301 代码块{}的使用,重定向, 从文件中读取行

    #!/bin/bash # 从 /etc/fstab 中读行 File=/etc/fstab {     read line1     read line2 } < $File # {}代码块, ...

  9. 移动端上下滑动事件之--坑爹的touch.js

    原文   http://blog.csdn.net/minidrupal/article/details/39611605 移动端页面的盛行,微信的便利的页面推广等等,让越来越多的css3效果和htm ...

  10. ubuntu14.04安装pycurl

    一. 安装依赖项 sudo apt-get install libcurl4-gnutls-dev 二. 安装pycurl pip install pycurl 三. 检验是否安装成功 进入pytho ...