虚位以待(AD)
虚位以待(AD)
首页 > 软件编程 > Android编程 > Android应用之最简main.xml说明

Android应用之最简main.xml说明
类别:Android编程   作者:码皇   来源:互联网   点击:

Android 应用之最简main xml说明 <?xml version="1 0" encoding="utf-8"?> 指示这个文本文件是以XML格式描述的<LinearLayout xmlns:android="http: schemas android com apk res android" XML描述文件

Android 应用之最简main.xml说明 <?xml version="1.0" encoding="utf-8"?> //指示这个文本文件是以XML格式描述的
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"//XML描述文件的名称空间是后面的URL网址
    android:layout_width="fill_parent"  //填满整个上层空间
    android:layout_height="fill_parent" //填满整个上层空间
    android:orientation="vertical" >      //这个界面的的版面配置方式是从上而下的垂直地排列其内含的界面组件

    <TextView                                    //显示文本,可以设定为可编辑.TextView是一个完整的文本编辑器,基类被配置成为不可编辑
        android:layout_width="fill_parent" //宽度值填满LinearLayout整个界面
        android:layout_height="wrap_content" //随着文字字段行数的不同而改变TextView的高度
        android:text="@string/hello" />  //显示对应的文字

</LinearLayout>

关于TextView,请见:http://developer.android.com/reference/android/widget/TextView.html

Android内建的版面配置方式

  

名称 配置方式
LinearLayout 线性版面配置
FrameLayout 框架版面配置
TableLayout 表格版面配置
RelativeLayout 相对位置版面配置
 




摘自  Alpha's Blog
相关热词搜索: Android 应用 之最