Android Studio不显示按钮的属性

时间:2018-12-31 00:49:18

标签: android android-studio button gradle attributes

我在Android Studio中打开了一个空白的Android应用程序,当我尝试编辑按钮时,属性不存在。我是Android开发的新手,并跟随着一个指南,该指南显示了如何更改按钮中的文本,但是属性菜单缺少该指南中看到的选项。

使用:

  • Android Studio 3.2.1
  • 4.6版(从4.5版更新)
  • Android插件版本3.2.1
  • Windows 10

我更新了Gradle,并在没有更改界面的情况下使缓存/重启无效。

界面外观:

enter image description here

界面应该的外观:

enter image description here

A similar situation that did not resolve my issue.

通过Android Studio的默认文件Templet创建的revlavent 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">

          <Button
              android:id="@+id/button"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginStart="8dp"
              android:layout_marginEnd="8dp"
              android:layout_marginBottom="8dp"
              android:text="@string/button"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent" />

          <EditText
              android:id="@+id/editText"
              android:layout_width="wrap_content"
              android:layout_height="0dp"
              android:ems="10"
              android:inputType="textPersonName"
              android:text="Name"
              tools:layout_editor_absoluteX="181dp"
              tools:layout_editor_absoluteY="337dp" />
      </android.support.constraint.ConstraintLayout>

2 个答案:

答案 0 :(得分:3)

请首先尝试检查您的XML代码中是否存在异常! 如果是,则先修复它,然后再修复 GOTO文件>使高速缓存无效并重新启动。重新启动后,请注意,启动需要花费更多时间,但这肯定会解决您的问题。

,如果不使用,则使用此

  

极端步骤

有很多解决方案可以处理android studio designView渲染。

在我使用低规格系统时,在大多数情况下我曾经做过的事情就是这样

如果WINDOWS是您的操作系统,则只需执行以下步骤:

1 :如果正在运行,请关闭您的Android Studio

2 :确保bottomBar或桌面中没有快捷图标(可选)

3:打开C:/ Users / {your_USER_NAME} /,然后删除.AndroidStudio {VERSIONCODE}文件夹

  

此文件夹有什么作用?好,它可以保存您的自定义android studio   主题,样式,快捷方式等

删除后

4 :检查您是否已连接到互联网

5 :打开android studio,它将再次为您显示设置屏幕,例如您要使用的主题等!随便推荐

6:首先执行建议的步骤,之后,如果缺少任何android studio,它将下载!

7:然后尝试创建一个新项目!

  

记住,您只需删除Android Studio的简单UI / UX故障,就无需删除.gradle!只需删除.androidStudo3。。(

答案 1 :(得分:1)

有同样的问题,可以解决。当我的.xml文件太大时,我通常会遇到此问题。

第一个解决方案(在线) 只需删除以下文件夹。

  

C:/Users/USER_NAME/.AndroidStudio3.x

如果有多个,则通常只删除最新的一个。无论如何,其他的都不常用。

第二个解决方案(脱机),创建一个新项目,然后将所有需要的文件复制到其中。