我試圖在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