TextView,setMovementMethod()方法实现文本可滚动出错
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Textview android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:id="@+id/TextView01" android:text="@string/hello" android:textSize="30sp"
/>
</LinearLayout>
package com.eoeAndroid.HelloTextView;
import android.app.Activity;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.widget.TextView;
public class HelloTextView extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView)findViewById(R.id.TextView01);
tv.setMovementMethod(ScrollingMovementMethod.getInstance());
}
}
运行后报错:
“The application HelloButton(process android.basic.lesson9) has stopped unexpectedly.Please try again.”?
谁能说说为什么吗