I am displaying text in a textview that appears to be too long to fit into one screen.
(我在textview中显示的文本似乎太长,无法容纳在一个屏幕中。)
I need to make my TextView scrollable. (我需要使TextView可滚动。)
How can I do that? (我怎样才能做到这一点?)
Here is the code:
(这是代码:)
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);
ask by Muhammad Maqsoodur Rehman translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…