我试图在Andriod中从左向右设置动画文本。这是我的代码从左到右动画文本在TextView Android中修剪文本
<TextView
android:id="@+id/scrolling_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#777777"
android:singleLine="true"
android:textSize="48sp" >
</TextView>
animation = new TranslateAnimation(-100.0f, screenWidth+300,
0.0f, 0.0f); // new TranslateAnimation(xFrom,xTo, yFrom,yTo)
animation.setDuration(Constants.ANIMATION_SPEED); // animation duration
animation.setAnimationListener(this);
tv.startAnimation(animation); // start animation
它动画,但它修剪文本。我试图放入水平滚动视图,但它修剪从对面(右)的文本。
我需要在Java中制作动画,因为动画完成后我需要更改文本并开始另一个。
你想达到什么目的?文本的水平滚动行? – Simas
是的。文本的水平滚动行 – MSaudi
一些更多的信息会很好。例如,文本是否更长,并且不适合屏幕,因此需要滚动?应该滚动循环? – Simas