当前位置: 代码迷 >> 综合 >> ApiDemo - View -Animation 学习
  详细解决方案

ApiDemo - View -Animation 学习

热度:6   发布时间:2024-01-21 15:51:08.0

今天学习apiDemo 这里面还是有很多值得借鉴的东西的 不用从网上乱找

text 显示的一些特效:

从下方推入:

<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android"><translate android:fromYDelta="100%p" android:toYDelta="0" android:duration="300"/><alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="300" />
</set>
左边推入

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


3D旋转动画:

 Rotate3dAnimation rotation;if (mPosition > -1) {mPhotosList.setVisibility(View.GONE);mImageView.setVisibility(View.VISIBLE);mImageView.requestFocus();rotation = new Rotate3dAnimation(90, 180, centerX, centerY, 310.0f, false);} else {mImageView.setVisibility(View.GONE);mPhotosList.setVisibility(View.VISIBLE);mPhotosList.requestFocus();rotation = new Rotate3dAnimation(90, 0, centerX, centerY, 310.0f, false);}rotation.setDuration(500);rotation.setFillAfter(true);rotation.setInterpolator(new DecelerateInterpolator());mContainer.startAnimation(rotation);


  相关解决方案