Android开发之ConstraintLayout布局
16lz
2021-12-04
最近开始在布局中使用拖拽方式了,留下记录自己看的
设置一条横向辅助线在屏幕的位置,按照百分比来设置
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:orientation="vertical"
更多相关文章
- Android(安卓)编程设置 APN
- Android(安卓)底层渲染 - 屏幕刷新机制源码分析
- Android虚拟机大屏幕设置
- Android(安卓)屏幕适配
- Android中获取屏幕相关信息(屏幕大小,状态栏、标题栏高度)
- Android:漫画APP开发笔记之ListView中图片按屏幕宽度缩放
- Android多屏幕支持Multi-WindowSupport
- Android(安卓)Map开发基础知识学习笔记(转)
- 安卓开发38:安卓的滚动条相关属性