ConstraintLayout子View设置match_parent后约束失效
16lz
2021-01-26
直接上效果图
...
image.png 问题
上面的代码想在注册布局放在toolbar下面,按照我的正常写法android:layout_width="match_parent"
android:layout_height="match_parent" 然后app:layout_constraintTop_toBottomOf="@+id/toolbar"放到toolbar下面但是注册页面还是覆盖了toolbar
原因
ConstraintLayout 布局不支持match_parent属性
解决方案
把注册布局android:layout_width,android:layout_height设置为0再添加约束,看效果
<?xml version="1.0" encoding="utf-8"?> ...
image.png
更多相关文章
- android中gridview的居中问题
- 安卓实现标题和按钮在一行,按钮靠最右边布局
- Android动态布局,并动态为TextView控件设置drawableLeft、drawabl
- Android(安卓)XRecyclerView实现多条目加载
- Android在layout xml中使用include .
- android中沉浸式布局的设置
- android 更改spinner默认样式
- Android屏蔽HOME键亲测可用
- [Android]RelativeLayout中最底的View其layout_marginBottom无效