Android studio 如何使用字幕从左向右滑动文本

Android studio 如何使用字幕从左向右滑动文本,android-studio,textview,ellipsize,Android Studio,Textview,Ellipsize,我正在使用marquee。在我的Android应用程序中,文本视图的原始值是aaabbbccc,它在视图中是合适的。所以我的字幕输出是:aaabbccc自动从右向左滑动。但是我不想这样,我想把这个AAABBCCC自动从左到右滑动。我怎样才能做到这一点…下面是我的xml文件。谢谢` android:id="@+id/txt_MainScreen_Winnerlist" android:layout_width="match_parent"

我正在使用marquee。在我的Android应用程序中,文本视图的原始值是aaabbbccc,它在视图中是合适的。所以我的字幕输出是:aaabbccc自动从右向左滑动。但是我不想这样,我想把这个AAABBCCC自动从左到右滑动。我怎样才能做到这一点…下面是我的xml文件。谢谢`
            android:id="@+id/txt_MainScreen_Winnerlist"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentTop="true"
            android:layout_marginLeft="-10dp"
            android:layout_marginTop="0dp"
            android:layout_marginRight="20dp"
            android:ellipsize="marquee"
            android:focusable="false"
            android:focusableInTouchMode="false"
            android:fontFamily="@font/proximanovaregular"
            android:gravity="center"
            android:marqueeRepeatLimit="marquee_forever"
            android:paddingTop="2dp"
            android:paddingRight="25dp"
            android:scrollHorizontally="true"
            android:singleLine="true"
            android:text="Exchange1:(00.14-2.30) Exchange2:(01.00-2.30) Exchange3:(05.00-6.30) Exchange4:(12.14-2.30) Exchange5:(10.00-12.30) Exchange6:(00.30-2.30) Exchange7:(03.00-05.00) "
            android:textSize="13dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent" />`

默认系统从右向左滚动。使用动画从左向右滚动

        Animation animationl2r = new TranslateAnimation(-400,400, 0, 0);
        animationl2r.setDuration(12000);
        animationl2r.setRepeatMode(Animation.RESTART);
        animationl2r.setRepeatCount(Animation.INFINITE);
        TextView textview = findViewById(R.id.textview);
        textview.setAnimation(animationl2r);

通过将400更改为任何其他值并将持续时间更改为所需时间来调整屏幕区域的大小。

默认系统从右向左滚动。使用动画从左向右滚动

        Animation animationl2r = new TranslateAnimation(-400,400, 0, 0);
        animationl2r.setDuration(12000);
        animationl2r.setRepeatMode(Animation.RESTART);
        animationl2r.setRepeatCount(Animation.INFINITE);
        TextView textview = findViewById(R.id.textview);
        textview.setAnimation(animationl2r);

通过将400更改为任何其他值并将持续时间更改为所需的时间来调整屏幕区域的大小。

@K M Rejowan Ahmmed谢谢。。。。。。!以上解决方案对我很有效。@K M Rejowan Ahmmed谢谢。。。。。。!以上的解决方案对我很有效。