Android初级学习重点提取

来源:互联网 发布:淘宝双11是什么意思啊 编辑:程序博客网 时间:2024/06/11 21:51

第一章    开发环境搭建略

第二章    android常用组件

1.       TextView  文本标签                                                                                       

2.      EditText   文本框、密码框                                                                                     

3.      Button    按钮                                                               

4.      RadioGroup  RadioButton单选框                        

5.      CheckBox 复选框

6.      Spinner 下拉列                                                                

7.      DatePicker                日期对话框                           

8.      TimePicker                时间对话框   

9.      ImageView               图片                                                 

10.  ImageButton    图片按钮                                                 

在main.xml中格式类似;例如:文本标签 输入框)

<TextView             以上10个及其他格式类似

    ……..

       …….

/>

图示:  主屏大小

 用户登录--------- TextView  文本标签  

 账号:--------- TextView  文本标签 

输入框)----------------EditText   文本框、密码框

密码:--------- TextView  文本标签  

输入框输入框)----------------EditText   文本框、密码框

自我介绍---------------TextView  文本标签

输入框输入框输入框)

输入框输入框 输入框)------------------EditText   文本框、密码框

输入框输入框 输入框)

确认取消----------------- Button    按钮  

Eg:

<?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:textColor="#FFFFFF"
        android:gravity="center"
        android:text="用户登录" />

<LinearLayout 
   android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        >
        <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="用户名:" />
<EditText 
   android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:lines="1"
   />
        
</LinearLayout>
<LinearLayout 
   android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        >
        <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="密码:" />
<EditText 
   android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:password="true"
        android:lines="1"
   />
        
</LinearLayout>
 
<LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    >
    <Button 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="13px"
        android:textColor="#FFFFCC"
        android:text="确定"
        />
    <Button 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="13px"
        android:layout_marginLeft="50px"
        android:text="取消"
        />
</LinearLayout>
    
<TableLayout 
    android:layout_width="fill_parent"
         android:layout_height="fill_parent"
        
    >
    <TableRow 
       android:layout_width="fill_parent"
          android:layout_height="fill_parent"
        >
       <Button 
           android:layout_weight="1"
           android:layout_height="wrap_content"
           android:textSize="15px"
           android:text="7"
           /> 
        <Button 
           android:layout_weight="1"
           android:layout_height="wrap_content"
           android:textSize="15px"
           android:text="8"
           />
        <Button 
           android:layout_weight="1"
           android:layout_height="wrap_content"
           android:textSize="15px"
           android:text="9"
           />
        <Button 
           android:layout_weight="1"
           android:layout_height="wrap_content"
           android:textSize="15px"
           android:text="+"
           />
    </TableRow> 
         <TableRow 
       android:layout_width="fill_parent"
          android:layout_height="fill_parent"
        >
       <Button 
           android:layout_weight="2"
           android:layout_height="wrap_content"
           android:textSize="15px"
           android:text="4"
           /> 
        <Button 
           android:layout_weight="2"
           android:layout_height="wrap_content"
           android:textSize="15px"
           android:text="5"
           />
        <Button 
           android:layout_weight="2"
           android:layout_height="wrap_content"
           android:textSize="15px"
           android:text="6"
           />
        <Button 
           android:layout_weight="2"
           android:layout_height="wrap_content"
           android:textSize="15px"
           android:text="-"
           />
    </TableRow>
  
</TableLayout>

</LinearLayout>


原创粉丝点击