相关疑难解决方法(0)

使TextView在Android上可滚动

我在textview中显示文本,看起来太长,无法放入一个屏幕.我需要让我的TextView可滚动.我怎样才能做到这一点?

这是代码:

final TextView tv = new TextView(this);
tv.setBackgroundResource(R.drawable.splash);
tv.setTypeface(face);
tv.setTextSize(18);
tv.setTextColor(R.color.BROWN);
tv.setGravity(Gravity.CENTER_VERTICAL| Gravity.CENTER_HORIZONTAL);
tv.setOnTouchListener(new OnTouchListener() {
    public boolean onTouch(View v, MotionEvent e) {
        Random r = new Random();
        int i = r.nextInt(101);
        if (e.getAction() == e.ACTION_DOWN) {
            tv.setText(tips[i]);
            tv.setBackgroundResource(R.drawable.inner);
        }
        return true;
    }
});
setContentView(tv);
Run Code Online (Sandbox Code Playgroud)

android scroll textview

736
推荐指数
18
解决办法
55万
查看次数

Android字符按字符显示文本动画

任何人都知道执行动画的任何有效方法,必须做的是逐个字符地显示文本,如:

T
Th
Thi
This
This i
这是
......

等等.

谢谢!

animation android text character

38
推荐指数
3
解决办法
4万
查看次数

标签 统计

android ×2

animation ×1

character ×1

scroll ×1

text ×1

textview ×1