1.设置各个组件的外边距:
android:layout_marginTop
android:layout_marginBottom
android:layout_marginLeft
android:layout_marginRight

2.设置组件相对于参考组件的位置,属性值为id
android:layout_above
android:layout_below
android:layout_toLeftOf
android:layout_toRightOf

3.设置组件与布局管理器哪边对齐,属性值为布尔类型
android:layout_alignParentBottom
android:layout_alignParentLeft
android:layout_alignParentRight
android:layout_alignParentTop

4.设置组件与某个组件的上下左右对齐:
android:layout_alignBottom
android:layout_alignLeft
android:layout_alignRight
android:layout_alignTop

设置组件位于布局管理器的哪个位置:
android:layout_centerHorizontal,水平居中
anrodi:layout_centerInparent,布局管理器中间
anrodi:layout_centerVertical,垂直居中

6.设置内边距
android:paddingBottom
android:paddingTop
android:paddingLeft
android:paddingRight

更多相关文章

  1. Android Studio第二十七期 - RecycleView不同item布局
  2. Android梅花布局,遥控器布局
  3. Layout布局
  4. LinearLayout布局中layout_weight的用法
  5. Anko:Android 代码动态布局的新方案
  6. Android局部布局替换实现
  7. Attribute is missing the Android namespace prefix——android
  8. Android显示调用App内部组件/第三方App内组件

随机推荐

  1. Structured Streaming VS Flink
  2. DevOps时代社区文章精选
  3. 台湾资深老专家:你实施敏捷的路子对吗?
  4. Shiro源码分析----登录流程
  5. 案例 | 可视化的方式解决 Dev 和 Ops 的
  6. 博文|你还在用python写API,赶紧体验全新cu
  7. 腾讯与百度的持续交付案例 | 乔梁专栏
  8. Juniper防火墙基于带外管理实例配置SNMP
  9. 注定不平凡的2019~~
  10. 直播 | 开启你的阿拉丁神灯