【问题标题】:Android layout design [closed]Android布局设计[关闭]
【发布时间】:2016-12-16 03:18:03
【问题描述】:

我正在开发我想要循环图像的应用程序。它会随着歌曲的播放而旋转。 谁能帮我开发这个布局。

【问题讨论】:

标签: android android-layout android-studio android-fragments


【解决方案1】:

使用此代码旋转您的图像视图

musicDisc = (ImageView)findViewById(R.id.musicDisc);
rotation = AnimationUtils.loadAnimation(MainActivity.this, R.anim.rotate);
rotation.setFillAfter(true);
musicDisc.startAnimation(rotation);

为了停止你可以使用清晰的动画

musicDisc.clearAnimation()

旋转.xml 保存在 res 文件夹中

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >

<rotate
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:fromDegrees="0"
    android:pivotX="50%"
    android:pivotY="50%"
    android:repeatCount="infinite"
    android:startOffset="0"
    android:toDegrees="360" />
</set>

【讨论】:

  • 告诉我。运行后
  • 嗨,我将此链接用于我的问题链接:android-arsenal.com/details/1/4218 - Damini Mehra 在上述评论中建议。无论如何。这对我的另一个模板也有帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-04-04
  • 2011-02-16
  • 2014-03-31
相关资源
最近更新 更多