<?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.”?
谁能说说为什么吗
<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.”?
谁能说说为什么吗
解决方案 »
- 请问一下我用手机访问webservice的问题
- android replace 无效
- 想学习iphone开发,不知从哪里入手,请教大牛!!!!!!
- android手机设置无动画,但UC的所有动画还有效,请问这是怎么做到的
- 手机RSS阅读器(全国高校竞赛,求高人指点)
- LinearLayout中的edittext,当点击edittext的时候不能弹出软键盘
- 怎么导出SIM卡里面的全部短信
- 问下关于android的layout_weight问题!!!!!!!!!!!!!!!!!!!!!!!!!
- 新手的初级问题,匿名类如何向外传递结果的问题
- 类HttpServlet
- NDK里打开/dev/graphics/fb0问题
- 在页面底部tab被文本遮挡显示不全,以下是xml求助帮改
在Textview的布局里面加上
android:scrollbars="vertical"(或者横向神马的)