如图这是问题布局
这是期望效果。
这是布局代码,本身是没有问题的。<?xml version="1.0" encoding="utf-8"?>
<data>
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/web_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<WebView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
但是。。。问题就出在这里。。。
然后布局就乱了。。。不要这个windowFu’llscreen就正常了。经过测试应该是有这个主题之后测量方式不一样。
仅以此记录遇到的坑。我找了好久都没找到问题。然后确实发现我的代码没有问题 T.T 所以希望以后不会再次遇到这样的坑。查了全网都没发现有跟我同样遇到这个问题的小伙伴。