How to animate the textview (very very long text )scroll automatically horizontally

前端 未结 11 920
长发绾君心
长发绾君心 2020-12-16 06:30

I am not interested in Marquee because, in Marquee you can not control the speed of marquee. I have tried to animate the textview but Parent view clips the text at the end e

11条回答
  •  自闭症患者
    2020-12-16 07:10

    Its really frustrating,... But the answer is simple, Use Edittext instead of TextView, and wrap it in horizontalscrollview At the same time, setfocusable: false

       
    
            
        
    

    Thanks to Hein, add the animation code

    final EditText textView =  view.findViewById(R.id.post_message);
            textView.startAnimation((Animation) AnimationUtils.loadAnimation(context,R.anim.horizontal_animation));
            String message="LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLong Text.";
            textView.setText(message);
    

提交回复
热议问题