Tag: 约束布局

约束布局在布局文件中不可见…并获取错误,同时膨胀任何视图

我正在使用约束布局( android.support.constraint.ConstraintLayout )作为我的XML文件中的主布局。 当我们得到两个视图的布局(一个是用户视图和第二个是拖放视图,并提供他们之间的关系)。但我只得到一个窗口是完全空白,看起来像下面: 并在使用我的layout.View任何视图时得到这个错误,请检查下面的图像 我的布局文件如下: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/constraintLayout" android:layout_width="match_parent" android:layout_height="match_parent" tools:layout_editor_absoluteY="25dp" tools:layout_editor_absoluteX="0dp"> <ImageView android:id="@+id/image_shot" android:layout_width="0dp" android:layout_height="wrap_content" tools:layout_editor_absoluteY="0dp" tools:layout_editor_absoluteX="0dp" /> </android.support.constraint.ConstraintLayout> 我已经尝试了下面的解决方案,但它不适合我,请检查链接,我已经搜查 1.第一链接 2.第二链接 3.第三链接 请帮我解决这个问题。谢谢