Textview marquee programmatically

前端 未结 2 794
梦如初夏
梦如初夏 2021-01-13 23:58

Trying to populate an textview(s) from an array. I managed to get the desired effect via XML via the code below



        
2条回答
  •  天涯浪人
    2021-01-14 00:40

    Try this.. It work

    TextView testing = (TextView) this.findViewById(R.id.testing);
    testing.setEllipsize(TextUtils.TruncateAt.MARQUEE);
    testing.setMarqueeRepeatLimit(-1);
    testing.setSingleLine(true);
    testing.setSelected(true);
    

提交回复
热议问题