How to include constraint layout to another constraint layout and set constraint between each(如何将约束布局包含到另一个约束布局并在每个约束布局之间设置约束)
问题描述
I'm using constraintLyout v 1.0.1.
I would like to include in my xml a sub ConstraintLayout corresponding to a part of my global layout (which itself is a ConstraintLayout). I split the layout in two xmls in order to use this sub part elsewhere
I tried this but I have no control on where to place my sub constraint layout in the parent. I wonder if I have to place everything in the same xml file or if their is a solution to use separate files.
tmp_1.xml
tmp_2.xml
The result is this
But i want it to be this
I tried this but it does not work
Actually found a solution. Android Studio does not autocomplete constraintLayout parameters in an include tag but they do have an impact on it as long as you give that include a size.
这篇关于如何将约束布局包含到另一个约束布局并在每个约束布局之间设置约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!