【问题标题】:android - how to load animation for all devices?android - 如何为所有设备加载动画?
【发布时间】:2013-11-09 07:22:26
【问题描述】:

我正在开发一个程序,该程序在新活动开始时使用简单的过渡动画。 列表所有行的动画集。

它在弱设备(如单核 xperia mini 和 LG 擎天柱黑色)上表现出色,但在 note 3 上它有延迟并且动画加载不流畅。

【问题讨论】:

  • overridePendingTransition(R.anim.animation, R.anim.animation2);

标签: android animation load smooth


【解决方案1】:

您必须将此文件添加到动画文件夹

动画.xml

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

动画2.xml

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

然后:

Intent slideactivity = new Intent(getApplicationContext(), SearchActivity.class);
startActivity(slideactivity);
overridePendingTransition(R.anim.animation, R.anim.animation2);

【讨论】:

    猜你喜欢
    • 2014-07-21
    • 1970-01-01
    • 1970-01-01
    • 2012-08-07
    • 2013-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-05
    相关资源
    最近更新 更多