layout_marginRight 的用法
2015-06-01 11:53
176 查看
转载:http://www.cnblogs.com/newlist/p/3255348.html
<?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" />
<?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" />
相关文章推荐
- 基于第三方微信授权登录的iOS代码分析
- 表单
- failed: unacceptable content-type: text/html
- MQTT协议之websocket方式发布接收消息
- ApachePhpMysql64位环境搭建
- haproxy安装部署
- Yii2 自定义class、全局函数
- 在线预览PDF格式的需求
- JS获取URL中参数值(QueryString)的4种方法分享
- UVA 10891 区间DP+博弈思想
- oracle cache缓存
- 防止事件重复提交代码
- Oracle表空间及分区表
- 基于zookeeper+leveldb搭建activemq集群
- android动画坐标定义
- Android APK反编译就这么简单 详解(附图)
- Jquery的html方法里包含特殊字符的处理
- CURL的学习和应用
- mysql数据库从库同步延迟的问题
- ActiveMQ之使用经验