ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

小视频源码,Android 页面跳转动画

2022-07-28 14:35:21  阅读:633  来源: 互联网

标签:动画 anim bottom 小视频 源码 push Android android out


小视频源码,Android 页面跳转动画

动画的xml文件

 


push_in.xml
<translate
    android:duration="300"
    android:fromYDelta="100%p"
    android:toYDelta="0" />
 push_out.xml
<translate
    android:duration="300"
    android:fromYDelta="0"
    android:toYDelta="100%p" />

第一种:overridePendingTransition

 

打开  A->B  (push_bottom_in B的动画,no_animation A的无动画)

 


startActivity(LoginActivity.class);
overridePendingTransition(R.anim.push_bottom_in, R.anim.no_animation);
关闭 B->A(push_bottom_out B的动画,no_animation A的无动画)
finish();
overridePendingTransition(R.anim.no_animation, R.anim.push_bottom_out);

 

无动画的设置

1.<translate xmlns:android="http://schemas.android.com/apk/res/android"

 


  android:fromYDelta="0"
  android:toXDelta="0"
  android:duration="1000"/>

 

2.调用overridePendingTransition(enterAnim, exitAnim)时,enterAnim和exitAnim如果有为0的值,指的是不设置该动画。

 第二种,设置activity的主题,theme

 


<!--登录画面动画-->
<style name="LoginActivityStyle" parent="@android:style/Animation">
    <item name="android:windowEnterAnimation">@anim/push_bottom_in</item>
    <item name="android:windowExitAnimation">@anim/push_bottom_out</item>
</style>
<style name="Loginanimation" parent="AppTheme">
    <item name="android:windowAnimationStyle">@style/LoginActivityStyle</item>
</style>

 

在manifest

 


android:theme="@style/Loginanimation"

 

以上就是 小视频源码,Android 页面跳转动画,更多内容欢迎关注之后的文章

 

标签:动画,anim,bottom,小视频,源码,push,Android,android,out
来源: https://www.cnblogs.com/yunbaomengnan/p/16528459.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有