如何android textview marquee getDuration?

发布于 2025-01-12 08:03:32 字数 107 浏览 3 评论 0原文

我有很多时间尝试 TextView 选取框动画滚动 需要选取框动画持续时间,完成监听器 请帮助我...

  1. 选框滚动时间
  2. 选框滚动终点或界面侦听器

I have time many try TextView marquee animation scroll
need marquee animation duration, finish Listener
plz help me...

  1. marquee scroll time
  2. marquee scroll finish point or interface listener

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云巢 2025-01-19 08:03:32

您可以在 anim res/anim/marquee.xml 中创建动画和动画时间

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:fromXDelta="100%"
        android:toXDelta="-100%"
        android:duration="10000"
        android:repeatCount="infinite"
        android:repeatMode="restart"
        android:interpolator="@android:anim/linear_interpolator"/>
</set>

,并在使用 textView 的位置调用它

 TextView myTextView = (TextView) findViewById(R.id.myTextView);
 Animation marquee = AnimationUtils.loadAnimation(this, R.anim.marquee);
 myTextView.startAnimation(marquee);

You can create animation and animation time like this in anim res/anim/marquee.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:fromXDelta="100%"
        android:toXDelta="-100%"
        android:duration="10000"
        android:repeatCount="infinite"
        android:repeatMode="restart"
        android:interpolator="@android:anim/linear_interpolator"/>
</set>

and call it where you are using your textView

 TextView myTextView = (TextView) findViewById(R.id.myTextView);
 Animation marquee = AnimationUtils.loadAnimation(this, R.anim.marquee);
 myTextView.startAnimation(marquee);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文