1.什么是TextView的控件?
TextView控件能向用户展示文本信息,我们可以设置该文本信息是否能够编辑。
2.TextView的两种基本使用方法:
(1)在程序中创建TextView对象
TextView tv = new TextView(this);
tv.setText("你好");
setContentView(tv); //把控件加载到Activity
(2)在XML布局文件中使用
<TextView
android:id="@+id/tv" //+号的作用是为了把控件放到R.java中
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20sp"
android:textColor="#FF0000"