新建一个文件“practice1.xml”

编写代码如下:

  <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="To"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Subject"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Message"
android:layout_weight="1"
android:gravity="top|left"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/button"
android:text="Reset"
android:layout_weight="1"
android:textAllCaps="false"
android:textSize="20sp"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/button2"
android:text="Send"
android:layout_weight="1"
android:textAllCaps="false"
android:textSize="20sp"/>
</LinearLayout>
</LinearLayout>

运行模拟器效果如下图:

Android—常用组件练习的更多相关文章

  1. Android常用组件

    UI相关 图片 Android-Universal-Image-Loader:com.nostra13.universalimageloader:异步加载.缓存.显示图片 ImageLoader:co ...

  2. Android常用组件【转】

    UI相关 图片 Android-Universal-Image-Loader:com.nostra13.universalimageloader:异步加载.缓存.显示图片 ImageLoader:co ...

  3. Android常用组件Broadcast介绍

    一.Broadcast简介 Broadcast是Android的四大组件之一.可分为: 1.普通广播 发送一个广播,所有监听该广播的广播接收者都可以监听到改广播. 2.异步广播 当处理完之后的Inte ...

  4. Android常用组件之AutoCompleteTextView

    安卓组件中,凡是需要配置数据的组件,一般都是用Adapter配置. AutoCompleteTextView的使用方法与ListView类似,也是用setAdapter来设置数据. MultiAuto ...

  5. Android常用组件之ListView

    使用ListAdapter是ListView的适配器. 使用ListView.setAdapter()方法来设置ListView的适配器. 简单的使用 adapter = new ArrayAdapt ...

  6. Android 高级UI设计笔记08:Android开发者常用的7款Android UI组件(转载)

    Android开发是目前最热门的移动开发技术之一,随着开发者的不断努力和Android社区的进步,Android开发技术已经日趋成熟,当然,在Android开源社区中也涌现了很多不错的开源UI项目,它 ...

  7. android开发常用组件【持续更新中。。。】

    UI相关 图片 Android-Universal-Image-Loader:com.nostra13.universalimageloader:异步加载.缓存.显示图片 ImageLoader:co ...

  8. React Native常用组件在Android和IOS上的不同

    React Native常用组件在Android和IOS上的不同 一.Text组件在两个平台上的不同表现 1.1 height与fontSize 1.1.1只指定font,不指定height 在这种情 ...

  9. Android业务组件化之子模块SubModule的拆分以及它们之间的路由Router实现

    前言: 前面分析了APP的现状以及业务组件化的一些探讨(Android业务组件化之现状分析与探讨),以及通信的桥梁Scheme的使用(Android业务组件化之URL Scheme使用),今天重点来聊 ...

随机推荐

  1. 火狐和IE的window.event对象详解(转载)

    FF的FIREBUG,不仅能测试JS还能检查CSS错误,是一般常用的. 但它主要检查FF方面的错误,对IE就无能为力了. 要测试IE,就用ieTester,它可以测试IE几乎所有版本(1.0恐怕也用不 ...

  2. python遍历文件夹下的文件

    在读文件的时候往往需要遍历文件夹,python的os.path包含了很多文件.文件夹操作的方法.下面列出: os.path.abspath(path) #返回绝对路径 os.path.basename ...

  3. android 定时器的使用

    1.android中通常是使用AlarmManager来定时启动一个单次或重复多次操作的.具体的说就是我们通过AlarmManager设定一个时间和注册一个intent到系统中,然后在该时间到来时,系 ...

  4. 【参考文献1】Word2010删除引用参考文献留下的横线

    那个莫名其妙不能选中,相信你也遇到.如果是这样,可能那个是尾注分隔符.你可以按照本文的方法解决.当然啦,这个也是按照网上的方法整理参考文献会留下的直线 Office Word2010 方法/步骤   ...

  5. bjui给出的一个标准应用的首页

    <!DOCTYPE html> <html lang="zh"> <head> <meta charset="utf-8&quo ...

  6. ZooKeeper启动过程2:FastLeaderElection

    前一篇文章中说到,启动ZooKeeper集群时,需要分别启动集群中的各个节点,各节点以QuorumPeer的形式启动,最后到达startLeaderElection和lookForLeader. 先说 ...

  7. SharePoint开发 - 自定义导航菜单(三)附其他代码

    博客地址 http://blog.csdn.net/foxdave 接上篇点击打开链接 LeftNavGroupTemplate.cs internal class LeftNavGroupTempl ...

  8. spring六种种依赖注入方式

    平常的java开发中,程序员在某个类中需要依赖其它类的方法,则通常是new一个依赖类再调用类实例的方法,这种开发存在的问题是new的类实例不好统一管理,spring提出了依赖注入的思想,即依赖类不由程 ...

  9. 求一个数组中最小的K个数

    方法1:先对数组进行排序,然后遍历前K个数,此时时间复杂度为O(nlgn); 方法2:维护一个容量为K的最大堆(<算法导论>第6章),然后从第K+1个元素开始遍历,和堆中的最大元素比较,如 ...

  10. 黑马程序员——【Java基础】——面向对象(二)异常机制、包(Package)

    ---------- android培训.java培训.期待与您交流! ---------- 一.异常机制 (一)异常概述 1.异常:就是程序在运行时出现不正常情况. 2.异常类:程序在运行时,出现的 ...