最近开始在布局中使用拖拽方式了,留下记录自己看的
设置一条横向辅助线在屏幕的位置,按照百分比来设置
activity_main.xml

<?xml version="1.0" encoding="utf-8"?>"http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent">"@+id/guideline3"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:orientation="horizontal"//这里控制方向,引导线在屏幕是横向还是纵向如果设置为vertical则效果如图二        app:layout_constraintEnd_toEndOf="parent"        app:layout_constraintGuide_percent="0.6"//设置在屏幕比例0。6的地方        app:layout_constraintStart_toStartOf="parent" />

效果:

    android:orientation="horizontal"

Android开发之ConstraintLayout布局_第1张图片

    android:orientation="vertical"

Android开发之ConstraintLayout布局_第2张图片

更多相关文章

  1. android布局学习利器-Hierarchy Viewer
  2. Android:漫画APP开发笔记之ListView中图片按屏幕宽度缩放
  3. Android 底层渲染 - 屏幕刷新机制源码分析
  4. Android多屏幕支持Multi-WindowSupport
  5. Android中获取屏幕相关信息(屏幕大小,状态栏、标题栏高度)
  6. Android虚拟机大屏幕设置
  7. Android adb获取屏幕分辨率

随机推荐

  1. Android adb常见问题
  2. Android Client 与 C# Server 的Socket通
  3. android 8.1 vts环境和测试
  4. android scrollview 相关
  5. 中国Android大牛
  6. Android实现蒙版弹出框效果
  7. sencha touch中处理Android返回按钮事件
  8. 关于android 全景开发
  9. Android获取屏幕的高度和宽度
  10. android adb 源码框架分析(1 系统)