小编Cic*_*llo的帖子

Android Studio不显示按钮的属性

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

使用方法:

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

我更新了Gradle并做了Invalidate Caches / Restart,没有更改接口。

我的界面外观:

在此处输入图片说明

如何接口应该看看:

在此处输入图片说明

类似的情况未能解决我的问题。

通过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>
Run Code Online (Sandbox Code Playgroud)

android attributes button gradle android-studio

2
推荐指数
1
解决办法
2296
查看次数

标签 统计

android ×1

android-studio ×1

attributes ×1

button ×1

gradle ×1