<?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. android中进度条控件
  2. android中设置控件获得焦点
  3. 时钟控件布局
  4. 通话距离感应实现源码
  5. Android 自定义组合控件
  6. Android Txt文本阅读器源码
  7. 简单控件的UI界面设计
  8. 第十二节(android常用控件三)
  9. android控件相对布局

随机推荐

  1. 封装Android OKHttp3.0请求工具
  2. android 7.0 使用apktool反编译apk
  3. 基于Android的短信管理系统
  4. Android 1.5 自带的图标一览表
  5. Android ContextMenu上下文菜单
  6. Android那些“没用“知识(一)
  7. Android 定时到服务器取数据并刷新
  8. Android 面试:常见问题总结
  9. android时间控件DatePicker使用实例
  10. android 水平进度对话框