ConstraintLayout 权重
时间: 2023-10-23 14:30:37 浏览: 82
Android ConstraintLayout的使用
在ConstraintLayout中,可以使用bias属性来实现权重的效果。bias属性可以用于控制子View在父布局中的位置偏移。对于水平方向的bias属性(layout_constraintHorizontal_bias),可以设置一个0到1之间的值,表示子View相对于父布局左边界的偏移程度。当bias的值为0时,子View会紧靠父布局的左边界,当bias的值为1时,子View会紧靠父布局的右边界。通过调整bias的值,可以实现子View的权重效果。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [android layout 按比例布局的代码](https://download.csdn.net/download/weixin_38670391/14883419)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Android中约束布局(ConstraintLayout)细节使用](https://blog.csdn.net/qq_36962321/article/details/110918709)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文