当前位置:操作系统 > 安卓/Android >>

Android 程式开发:(十)基本控件 —— 10.1 TextView

当你创建一个新的Android项目,Eclipse通常总是会创建main.xml文件,当中包含一个<TextView>元素。

[html] 
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 
 
    <TextView 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="@string/hello" /> 
 
</LinearLayout> 
TextView用来给用户展示文本信息。这是最基本的控件,当你开发Android应用程序的时候,总是会使用到它。如果你希望用户能够修改文本信息,你也可以使用TextView的子类,EditText。

补充:移动开发 , Android ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,