问题描述
我要滚动字幕文本,当字幕结束(1全选取框循环),我想要触发另一个事件。有没有做到这一点的好办法?我还没有看到一个OnEnd或相似的功能时,字幕-ING一个TextView
I want to marquee text, and when the marquee completes (the 1 full marquee cycle), I want to trigger another event. Is there a good way to do this? I haven't seen an OnEnd or similar function when marquee-ing a textview
推荐答案
使用自定义的的TextView
,您可以覆盖的onDraw
使用反射对 mMarquee
字段和 MSTATUS
的字段 mMarquee
字段(见的grep code或TextView的等code)。
using a custom TextView
, you can override onDraw
to use reflection on mMarquee
field and on mStatus
field of the mMarquee
field (see TextView code on grepcode or such).
MSTATUS
值为2时,字幕正在运行,0时停止。
mStatus
value is 2 when marquee is running, and 0 when stopped.
的onDraw
被称为很多,但特别是,它被称为字幕完毕之后。
onDraw
is called a lot, but in particular, it is called right after the marquee is completed.
这篇关于选取框完成后起火事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!