而TextView有內建的Scrollbars,透過以下幾個步驟就能叫出來嘍!
[xml]
在TextView中增加下方屬性
android:scrollbars="vertical" <!-- 卷軸設定為縱向 -->android:singleLine="false" <!-- 資料為多行 -->
[java]
程式中也需要呼叫捲軸的方法
TextView text = (TextView) findViewById(R.id.textview1);text.setMovementMethod(ScrollingMovementMethod.getInstance());
沒有留言:
張貼留言