wrap_content

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="测试填满父控件的空白" />

layout_marginTop

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="测试与上边的距离" />

layout_marginLeft

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
android:text="测试与左边距离" />

paddingLeft

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="40sp"
android:text="测试空间内左边距" />

padding

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="20sp"
android:paddingBottom="20sp"
android:paddingLeft="40sp"
android:paddingRight="40sp"
android:text="测试空间内边距" />

gravity

<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="测试文字居中" />

<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:text="测试文字居左" />

<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="测试文字居右" />

最新文章

  1. iOS-----App闪退,程序崩溃---解决方案
  2. WindowsForm如何实现类似微软project软件的甘特图?
  3. iOS开发 multipart 上传多张图片
  4. servlet设置缓存时间以及文件的下载
  5. CSS3之边框样式(动画过渡)
  6. 连续调用inet_ntoa打印出错的问题
  7. Android:布局实例之常见用户设置界面
  8. ACdream 1017 Fast Transportation
  9. .Net Web开发中实现剪切板功能
  10. xcode6 iOS sdk8.1隐藏系统状态栏
  11. JAVA中extends&#160;与implements的用法
  12. CORS跨域资源共享你该知道的事儿
  13. 004-谈一谈lock和synchronized
  14. 安装oracle时修改Linux版本问题
  15. centos/redhat/ubuntu不同之处
  16. 修改docker容器的端口映射
  17. SAP接口的调用
  18. DevExpress 使用条形码二维码控件打印
  19. 利用HBuilder打包前端开发webapp为apk
  20. 2018.07.10NOIP模拟 Draw(容斥原理)

热门文章

  1. python爬虫爬小说网站涉及到(js加密,CSS加密)
  2. JMeter命令行执行+生成HTML报告
  3. FCC---Create a Gradual CSS Linear Gradient
  4. jdbc大略
  5. 【JDBC】JDBC入门
  6. Nginx web基础入门
  7. PHP生成唯一ID
  8. Centos7系统Docker安装
  9. 前端JSON请求转换Date问题
  10. 阿里云ubuntu 16.04 搭建pptpd 第二版