gpt4 book ai didi

android - 在 TextView 中移动文本

转载 作者:搜寻专家 更新时间:2023-11-01 09:05:11 25 4
gpt4 key购买 nike

TextView txt = new TextView(this);
txt.setText(“This is moving text”);
txt.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
txt.setTextColor(Color.rgb(187, 88, 15));
txt.setPadding(10, 10, 0, 0);
txt.setEllipsize(TruncateAt.MARQUEE);
txt.setSingleLine();
txt.setMarqueeRepeatLimit(10);
txt.setFocusable(true);
txt.setHorizontallyScrolling(true);
txt.setFocusableInTouchMode(true);
txt.requestFocus();
txt.setTypeface(Typeface.SERIF,Typeface.BOLD);

I tried to create the moving text for the textview but it will not moving . i try to use setMarqueeRepeatLimit . how to do it?

最佳答案

the answer is:

TextView txt = new TextView(this);     
txt.setText(“This is moving text”);
txt.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
txt.setTextColor(Color.rgb(187, 88, 15));
txt.setPadding(10, 10, 0, 0);
txt.setEllipsize(TruncateAt.MARQUEE);
txt.setSingleLine();
txt.setMarqueeRepeatLimit(10);
txt.setFocusable(true);
txt.setHorizontallyScrolling(true);
txt.setFocusableInTouchMode(true);
txt.requestFocus();
txt.setLayoutParams(new TableRow.LayoutParams(130, TableRow.LayoutParams.FILL_PARENT));
txt.setTypeface(Typeface.SERIF,Typeface.BOLD);

关于android - 在 TextView 中移动文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12434797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com