Android初级学习重点提取

第一章    开发环境搭建略

第二章    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>


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值