3

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:

enter image description here

How the interface should look:

enter image description here

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>
8
  • Double check your button Text color is not the same as your button background
    – shizhen
    Dec 31, 2018 at 1:05
  • I wouldn't be able to change the text color if I wanted too as the attribute to change such a value is not present. Here is an example with plain text i.imgur.com/BXLi1nq.png
    – Ciccarello
    Dec 31, 2018 at 1:09
  • can post your layout .xml file?
    – shizhen
    Dec 31, 2018 at 1:10
  • I believe this is what you are looking for i.imgur.com/HjOZgeA.png Bare in mind this is a blank file freshly created using Android Studio's default file.
    – Ciccarello
    Dec 31, 2018 at 1:19
  • don't post image here, but update your questions with the text content.
    – shizhen
    Dec 31, 2018 at 1:24

3 Answers 3

9

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..(

3
  • Thank you! Removing the .AndroidStudio folder resolved the issue. I loaded the most default settings I could including using not Darula (ew) and whatever was the default Android version it wanted. The attributes showed up properly. Then I opened the project I was already working on, and the attributes persisted. I will keep that trick in my bag for the future headache inducing issue.
    – Ciccarello
    Dec 31, 2018 at 2:06
  • 1
    please upvote and accept the answer then! thanks @Ciccarello Dec 31, 2018 at 2:06
  • 1
    @Ciccarello glad that it helped! Dec 31, 2018 at 2:10
1

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.

0

of your backup of the .idea folder within the project. Replace all files inside. Then open the project and Sync Project with gradle files.

1
  • seems like the beginning of the first sentence is missing
    – JanPl
    Nov 5, 2022 at 22:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.