Android Studio 不显示按钮的属性

标签 android android-studio button gradle attributes

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

使用:

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

我更新了 Gradle 并做了 Invalidate Caches/Restart 并且没有改变界面。

我的界面看起来如何:

enter image description here

界面应该的样子:

enter image description here

A similar situation that did not resolve my issue.

通过 Android Studio 的默认文件模板创建的 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>

最佳答案

请先尝试检查您的 XML 代码是否有任何异常! 如果是,则先修复它,然后再修复 GOTO File > Invalidate Caches and Restart. 重启后请注意,启动需要一点时间,但这肯定会解决您的问题。

如果不行就用这个

EXTREME STEP

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

当我使用低规范系统时,我曾经在极端情况下做的事情是这样的

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

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

2:确保底部栏或桌面上没有快捷方式图标(可选)

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

what does this folder do? well it saves your custom android studio themes, styles, shortcuts etc

删除后

4:检查您是否已连接到 Internet

5: 打开 android studio,它应该会再次显示设置屏幕,例如您想使用的主题等!就去推荐

6:首先按照推荐的步骤进行操作,之后如果缺少任何 android studio 就会下载!

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

REMEMBER you do not need to remove .gradle for just simple UI/UX glitches of android studio! just remove .androidStudo3..(

关于Android Studio 不显示按钮的属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53982649/

相关文章:

java - 从 Android Studio 中的自定义应用发送电子邮件 + 附件,为什么 URI 为空?

android - 从 Eclipse 导入 AS 后的 Google Play 服务

android - 在android中保存/恢复自定义 View 的状态

android - Gradle Wrapper在多个项目中一次又一次下载gradle行为

javascript - 播放和暂停播放声音

ios - 如何使用过渡快速滑动和隐藏按钮

android - Qt Creator中Android项目编译报错 "cannot find -lc++"如何解决?

java - 自定义 ParseQueryAdapter 未填充 Android ListView

android - 应用程序打开时停止推送通知振动

mysql - 运行 mysql 查询的按钮