线性布局:

 1 <?xml version="1.0" encoding="utf-8"?>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="match_parent"
4 android:layout_height="match_parent"
5 android:orientation="vertical" >
6 <!-- 上下左右全部填充100dp最终是已后加载的为准 -->
7 <TextView
8 android:id="@+id/tv_number"
9 android:layout_width="match_parent"
10 android:layout_height="wrap_content"
11 android:layout_marginLeft="30dp"
12 android:layout_margin="100dp"
13 android:text="请输入电话号码"/>
14 <EditText
15 android:layout_width="match_parent"
16 android:layout_height="wrap_content"
17 android:hint="请输入电话号码"
18 />
19
20
21 <Button
22 android:layout_width="wrap_content"
23 android:layout_height="wrap_content"
24 android:text="拨打"
25 />
26
27 </LinearLayout>

相对布局:

 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2 xmlns:tools="http://schemas.android.com/tools"
3 android:layout_width="match_parent"
4 android:layout_height="match_parent"
5 tools:context=".MainActivity" >
6 <!-- 相对布局默认都是从左上角开始布局 -->
7 <TextView 8 android:id="@+id/tv_number"
9 android:layout_width="wrap_content"
10 android:layout_height="wrap_content"
11 android:text="请输入电话号码" />
12
13 <EditText
14 android:id="@+id/et_number"
15 android:layout_width="match_parent"
16 android:layout_height="wrap_content"
17 android:hint="请输入电话号码"
18 android:layout_below="@id/tv_number"
19 />
20
21 <Button
22 android:id="@+id/btn_number"
23 android:layout_width="wrap_content"
24 android:layout_height="wrap_content"
25 android:text="拨打"
26 android:layout_below="@id/et_number"
27 />
28
29 <Button
30 android:layout_width="wrap_content"
31 android:layout_height="wrap_content"
32 android:text="按钮"
33 android:layout_toRightOf="@id/btn_number"
34 android:layout_below="@id/et_number"
35 />
36
37
38 </RelativeLayout>

Five Android layouts的更多相关文章

  1. Android应用程序支持不同屏幕(尺寸、密度)

    how to build a user interface using Android layouts for all types of devices 使用Android布局设计的UI接口用于不同的 ...

  2. Android 程序 LinearLayout布局 参数layout_weight 探讨

    官方参考文档 对LinearLayout.LayoutParams中的android:layout_weight解释如下:Indicates how much of the extra space i ...

  3. Android chromium 1

    For Developers‎ > ‎Design Documents‎ > ‎ Java Resources on Android Overview Chrome for Android ...

  4. Space and GridLayout 教程

    Ice Cream Sandwich (ICS) sports two new widgets that have been designed to support the richer user i ...

  5. Android用户界面布局(layouts)

    Android用户界面布局(layouts) 备注:view理解为视图 一个布局定义了用户界面的可视结构,比如activity的UI或是APP widget的UI,我们可以用下面两种方式来声明布局: ...

  6. 第13章、布局Layouts之RelativeLayout相对布局(从零開始学Android)

    RelativeLayout相对布局 RelativeLayout是一种相对布局,控件的位置是依照相对位置来计算的,后一个控件在什么位置依赖于前一个控件的基本位置,是布局最经常使用,也是最灵活的一种布 ...

  7. Android开发:界面设计之六大layouts介绍

    1.帧布局 FrameLayout: FrameLayout是最简单的布局对象.在它里面的的所有显示对象都将固定在屏幕的左上角,不能指定位置,后一个会直接覆盖在前一个之上显示 因为上面的一段话这个是在 ...

  8. Android开发者的Anko使用指南(四)之Layouts

    为什么不使用xml绘制Andoird的UI? 类型不安全 非空不安全 xml迫使你在很多布局中写很多相同的代码 设备在解析xml时会耗费更多的cpu运行时间和电池 最重要的时,它允许任何代码重用 简单 ...

  9. [Android]异步 layout inflation(翻译)

    以下内容为原创,欢迎转载,转载请注明 来自天天博客:http://www.cnblogs.com/tiantianbyconan/p/5829809.html 异步 layout inflation ...

随机推荐

  1. HoloLens开发手记 - 使用HoloLens模拟器 Using HoloLens emulator

    首先下载HoloLens模拟器 HoloLens模拟器运行在没有真机的情况下在你的PC上测试应用,属于HoloLens开发工具系列.模拟器使用了Hyper-V虚拟机.通常通过传感器获取的人体和环境输入 ...

  2. can only concatenate tuple (not "int") to tuple问题原因

    #测试程序 import os from pydub import AudioSegment #已经确定, # enPath = "%s%s/%s"%(enDir,file,enf ...

  3. PostgreSQL查询优化逻辑优化之其他

    上一节我们介绍了PostgreSQL的子查询优化,子查询优化把一部分可以优化的子查询上拉到主查询成为join. preprocess_expression 将表达式(目标列,where,join,ha ...

  4. NIO ServerSocketChannel ScoketChannel

    package com.yb.nio; import java.io.IOException; import java.net.InetSocketAddress; import java.net.S ...

  5. biztalk rosettanet 自定义 pip code

    USE [BTARNDATA] GO /****** Object: StoredProcedure [dbo].[proc_GetActivityStatus] Script Date: 09/16 ...

  6. Spring的第四天AOP之注解版

    Spring的第四天AOP之注解版 ssm框架 spring  在上一篇博客中,介绍了Spring的AOP的xml版本的使用,在这篇博客中,我将介绍一下,注解版的使用. 常用注解 注解 通知 @Aft ...

  7. netty源码解解析(4.0)-6 线程模型-IO线程EventLoopGroup和NIO实现(一)

    接口定义 io.netty.channel.EventLoopGroup extends EventExecutorGroup 方法 说明 ChannelFuture register(Channel ...

  8. [转]window7下利用DockerToolbox安装Docker

    本文转自:https://blog.csdn.net/qq2712193/article/details/54576313 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blo ...

  9. MVC中子页面如何引用模板页中的jquery脚本

    MVC中子页面如何引用模板页中的jquery脚本 最近在学习mvc,遇到了一个问题:在html页面中写js代码,都是引用mvc5自带的jquery脚本,虽然一拖(将指定的jquery脚本如 jquer ...

  10. url字符长度限制解决办法

    前段时间,同事往系统上传相关文档,发现输入失败,找到了我了. 开始以为数据库字段属性问题,修改后未解决随调试系统,发现没有走到后台程序,发现 ajax没有传值,各种测试问题情况,后来同事发现是url字 ...