<?xml version = "1.0" encoding = "utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_height="fill_parent"
android:layout_width="fill_parent"
> <Button
android:id="@+id/button_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="60dp"
android:layout_marginBottom="100dp"
android:text="我是第1个控件"
android:textSize="12sp" /> <Button
android:id="@+id/button_test1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="15sp"
android:layout_below="@+id/button_test"
android:paddingLeft="20sp"
android:layout_gravity="right"
android:text="我是第2个控件"
android:textSize="12sp" /> <ListView
android:id="@+id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/button_test1" /> </LinearLayout>
<Button
android:id="@+id/button_test"
android:layout_width="wrap_content"//大小刚刚可以包住文本
android:layout_height="wrap_content"
android:layout_marginTop="30dp"//相对上方控件的距离
android:layout_marginLeft="40dp"//相对左边控件的距离
android:layout_marginRight="60dp"//相对右边控件的距离
android:layout_marginBottom="100dp"//相对下方控件的距离
android:text="我是第1个控件"
android:textSize="12sp" />//设置文本的大小 <Button
android:id="@+id/button_test1"
android:layout_width="match_parent"//宽度跟父窗口是一样的
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:paddingTop="15sp"
android:layout_below="@+id/button_test"//使该控件一直在第一个控件的下方
android:paddingLeft="20sp"//文本相对控件左边的距离
android:gravity="right"//表示文本的对齐方式
android:text="我是第2个控件"
android:textSize="12sp" />

最新文章

  1. PDO连接mysql和pgsql数据库
  2. MVC 图片预览
  3. iOS tableview 选中Cell后的背景颜色和文字颜色
  4. Http 请求
  5. EventBus3.0使用总结
  6. 日文“表” php 会报错
  7. [转]Windows与Linux系统下的库文件介绍
  8. SQLServer批量备份与还原
  9. sql 学习笔记 档
  10. php 语法中有 let 吗?
  11. JS 与 OC
  12. PHP二维关联数组的遍历方式
  13. 解决报错:IncompleteElementException: Could not find result map...
  14. scrapy爬虫学习系列四:portia的学习入门
  15. 树状数组 || JZOI 1024. @szefany 的树
  16. [USACO18JAN]Cow at Large P
  17. 【模拟与阅读理解】Gym - 101954C Rullete
  18. 第 8 章 容器网络 - 065 - 容器在 Weave 中如何通信和隔离?
  19. pyinstaller将py文件转成exe格式
  20. word绘图画布

热门文章

  1. Hibernate(五)基本数据类型
  2. java程序员认证考试题库
  3. jdeveloper优化:
  4. 在Ubuntu下设置默认编辑器
  5. 在js里双引号里又加单引号的解决方案常用WdatePicker
  6. js 判断iframe是否加载完毕
  7. git工具 将源码clone到本地指定目录的三种方式
  8. Xcode8的调试技能Memory Graph 实战解决闭包引用循环问题
  9. 基于node.js的web框架express
  10. Linux命令-查看进程命令:pstree