ConstraintLayout 的使用
来源:互联网 发布:网络整合营销理论 原则 编辑:程序博客网 时间:2024/05/17 02:53
- 介绍
- 使用前配置
- 重点内容
1 介绍
约束布局是Google官方推出新的布局解决方案,能够解决布局嵌套过深问题,同时还能够简化布局所需要的时间。之前在beta版本就使用了,使用中可能会报错的情况已经解决,而且还带来了ratio的设置,同时Studio升级到2.3后视图预览效果比较好。官方现在主推这个布局,新建的Activity都是ConstraintLayout默认了。
ConstraintLayout is available in an API library that’s compatible with Android 2.3 (API level 9) and higher. This page provides a guide to building a layout with ConstraintLayout in Android Studio 2.3 or higher. If you’d like more information about the Layout Editor itself, see the Android Studio guide to Build a UI with Layout Editor.
2 使用前配置
To use ConstraintLayout in your project, proceed as follows:
Ensure you have the latest Constraint Layout library:
1. Click Tools > Android > SDK Manager.
2. Click the SDK Tools tab.
3.Expand Support Repository and then check ConstraintLayout for Android and Solver for ConstraintLayout. Check Show Package Details and take note of the version you’re downloading (you’ll need this below).
4.Click OK.
5. Add the library as a dependency in your module-level build.gradle file: dependencies {
compile 'com.android.support.constraint:constraint-layout:1.0.1'
}
The library version you download may be higher, so be sure the value you specify here matches the version from step 3.
6. In the toolbar or sync notification, click Sync Project with Gradle Files.
Now you’re ready to build your layout with ConstraintLayout.
3 重点内容
- Control linear groups with a chain
- Set size as a ratio
- Constrain to a guideline
- ConstraintLayout的简单使用
- ConstraintLayout 的使用
- ConstraintLayout的使用
- ConstraintLayout的使用介绍
- ConstraintLayout的学习使用
- ConstraintLayout的基本使用
- Android ConstraintLayout布局的使用
- ConstraintLayout布局的基本使用
- ConstraintLayout布局的基本使用
- Android ConstraintLayout的基本使用
- ConstraintLayout使用解析并去掉ConstraintLayout的默认布局方式
- ConstraintLayout使用解析并去掉ConstraintLayout的默认布局方式
- 使用ConstraintLayout创建复杂的表单布局
- ConstraintLayout约束布局的概念与使用
- 使用ConstraintLayout构建一个灵活的布局
- 2017/02/10 使用 ConstraintLayout 的总结
- Android新布局ConstraintLayout的使用
- ConstraintLayout 属性详解 和Chain的使用
- 大话设计模式 商场促销 工厂模式和策略模式 c++
- Android下的Fragment
- web技术栈中不可或缺的Linux技术
- 透彻理解LINUX下TCP的发送缓冲区接收缓冲区与滑动窗口
- sping学习笔记
- ConstraintLayout 的使用
- Vim Editor Assistant
- 117:Search for a Range
- 主动信息收集之端口扫描的一些脚本
- C语言描述:单向链表的相关操作
- MySQL设置主键外键时错误:ERROR 1064 (42000)
- 字符串相关Tips
- LeetCode Week5:Recover Binary Search Tree、Binary Tree Maximum Path Sum
- 人脸识别数据库