简体   繁体   中英

Android Studio not showing attributes for button

I opened a blank Android application in Android Studio and when I attempt to edit a button, the attributes are not present. I'm new to Android development and following a guide which shows how to change the text in the button, but the attributes menu lacks the options seen in the guide.

Using:

  • Android Studio 3.2.1
  • Gradle 4.6 (Updated from 4.5)
  • Android Plugin Version 3.2.1
  • Windows 10

I updated Gradle and did Invalidate Caches/Restart with no change to the interface.

How my interface looks:

在此处输入图片说明

How the interface should look:

在此处输入图片说明

A similar situation that did not resolve my issue.

The revlavent XML file which was created via Android Studio's default file templet

      <?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>

Please try this first check if there is any anomaly in your XML code! if yes then fix it first and then GOTO File > Invalidate Caches and Restart. After restart note that it takes a little more time to start but this will surely fix your issue.

and if that does not then use this

EXTREME STEP

Well there are plenty of solutions to deal with android studio designView Rendering.

what i used to do in my utmost cases when i was kind of on low spec system is something like this

if WINDOWS is your OS then just follow the steps:

1: Close your Android studio if running

2: Make sure no shortcut icon is present in the bottomBar or desktop(optional)

3: Open C:/Users/{your_USER_NAME}/ and just delete .AndroidStudio{VERSIONCODE} folder

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

after deleting it

4: Check you are connected to Internet

5: open the android studio and it should present you with again setting screens like what theme you would like to use etc! just go with recommended

6: follow the recommended steps at first after that if anything android studio is missing it will download!

7: try creating a new project then!

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

Got the same issue, it is fixable. I usually get this problem when i have too big .xml files.

First solution (Online) Just delete the following folder.

C:/Users/USER_NAME/.AndroidStudio3.x

If you have more than one, you usually have to delete just the newest one. The other ones aren't usually used anyway.

Second solution (Offline) Create a new Project and just copy all the needed files inside.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM