网站及单位网站建设情况,常熟做网站多少钱,深圳坪山很偏僻吗,怎么做一个设计师网站前言在android开发中#xff0c;我们通常是手写布局#xff0c;很少会用拖动来写布局#xff0c;虽然constraintlayout在i/o上以拖动来展现了各种功能#xff0c;我估计在以后开发中#xff0c;程序员还是习惯手撸代码。我自己试着拖着用了一下#xff0c;用得不是很明白…前言在android开发中我们通常是手写布局很少会用拖动来写布局虽然constraintlayout在i/o上以拖动来展现了各种功能我估计在以后开发中程序员还是习惯手撸代码。我自己试着拖着用了一下用得不是很明白 而且用起来效果不是很好。那么直接上手撸了一下~~~其实很简单button1:app:layout_constraintbottom_totopofid/iv_head我们把这个属性拆开来看constraintbottom指的本身的底部即button1的顶部totopof是指imageview的顶部那么这句话的意思就是aligns the bottom of the desired view to the top of another.(官方原文)翻译一下就是button1的底部要和imageview的顶部对齐button1 app:layout_constraintright_toleftofid/iv_head根据上面的规则我们就知道button1的右边要和imageview的左边对齐。其实很简单就是说两个view的某个方位要对齐没了就这么简单其它属性可以举一反三它比relativelayout控制起来更加得以就手。layout_constrainttop_totopof — align the top of the desired view to the top of another.layout_constrainttop_tobottomof — align the top of the desired view to the bottom of another.layout_constraintbottom_totopof — align the bottom of the desired view to the top of another.layout_constraintbottom_tobottomof — align the bottom of the desired view to the bottom of another.layout_constraintleft_totopof — align the left of the desired view to the top of another.layout_constraintleft_tobottomof — align the left of the desired view to the bottom of another.layout_constraintleft_toleftof — align the left of the desired view to the left of another.layout_constraintleft_torightof — align the left of the desired view to the right of another.layout_constraintright_totopof — align the right of the desired view to the top of another.layout_constraintright_tobottomof — align the right of the desired view to the bottom of another.layout_constraintright_toleftof — align the right of the desired view to the left of another.layout_constraintright_torightof — align the right of the desired view to the right of another.if desired, attributes supporting start and end are also available in place of left and right alignment.到此你已经掌握了一大半的constraintlayout知识点还有其它的一些属性app:layout_constraintstart_toendof意思就是button的开始部分(从左往右看开始部分就是button的左边)与imageview的右边是对齐的。app:layout_constraintstart_tostartof这个就是说button的左边与imageview的左边是对齐的不知道为什么上面已经出的属性能够满足布局需要了为什么还要再出start和end的。总结以上就是这篇文章的全部内容了希望本文的内容对大家的学习或者工作能带来一定的帮助如果有疑问大家可以留言交流谢谢大家对萬仟网的支持。