约束布局在android studio中不可见

约束布局在android studio中不可见,android,android-layout,android-studio,Android,Android Layout,Android Studio,我的问题我在android studio中创建了一个应用程序,其.xml文件设计不可见,尽管其文本对我可见,请提供解决方案 下面是它的外观: 我的文本文件.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http

我的问题我在android studio中创建了一个应用程序,其.xml文件设计不可见,尽管其文本对我可见,请提供解决方案

下面是它的外观:

我的文本文件.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Hello World!"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.52" />

<EditText
    android:id="@+id/editText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:ems="10"
    android:inputType="numberDecimal"
    tools:ignore="MissingConstraints"
    tools:layout_editor_absoluteX="148dp"
    tools:layout_editor_absoluteY="137dp" />

<Button
    android:id="@+id/button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button"
    tools:ignore="MissingConstraints"
    tools:layout_editor_absoluteX="0dp"
    tools:layout_editor_absoluteY="0dp" />

<android.support.v7.widget.RecyclerView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:ignore="MissingConstraints"
    tools:layout_editor_absoluteX="8dp"
    tools:layout_editor_absoluteY="8dp" />

<TextView
    android:id="@+id/textView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TextView"
    tools:ignore="MissingConstraints"
    tools:layout_editor_absoluteX="217dp"
    tools:layout_editor_absoluteY="67dp" />

///请为此提供解决方案我认为解决您问题的方法就是将您的风格主题从

    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
改为

    <style name="AppTheme" parent="Base.Theme.AppCompat.Light.NoActionBar">
尝试在编辑器中更改API版本

编辑

尝试同步项目


尝试无效并重新启动

File->Invalidate and Restart

确保在构建中添加了以下依赖项。gradleModule:app文件

 implementation 'com.android.support.constraint:constraint-layout:1.0.2'

你能发布你的XML代码吗?点击文本选项卡而不是设计选项卡,你使用的是哪个版本的编译器?发布我的XML代码你能发布你的构建吗?gradleModule:app?我应该在哪里更改它??我需要我的.xml文件?转到res>values>styles.xml,然后更改样式并生成项目,然后可以发布生成。gradleModule:app?尝试同步项目