拖放功能在Android Studio中不起作用。甚至无法点击以显示属性

时间:2019-01-06 19:31:01

标签: android-studio android-studio-3.2

我想将元素拖放到“设计视图”中,但我不能。单击屏幕或显示“ Hello World!”的默认TextView时,我什至看不到这些属性。我尝试重新启动Android Studio,重建项目,但是仍然有问题。

下面的代码来自我的文件'activity_main.xml'。

是怎么发生的? 我只是试图在屏幕设计中添加一个“ GridLayout”,但是要使用它,我必须安装一个库以使用该网格布局,并且由于这样做了,所以我无法再使用设计视图。

即使我遇到“ IDE致命错误”(下面的屏幕截图)。

错误提示图片:
error ide image

<?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"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    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" />

</android.support.constraint.ConstraintLayout>

1 个答案:

答案 0 :(得分:0)

删除 实现'com.android.support.constraint:constraint-layout:+' 从您的build.gradle(应用程序) 希望能解决这个问题