ericlee
ericlee

Reputation: 2753

Android Studio, design view empty

I'm using 1.4. I've tried to uninstall and reinstall again. still same problem. any solution? enter image description here

Upvotes: 10

Views: 12280

Answers (6)

Samet Cesmebasi
Samet Cesmebasi

Reputation: 91

Go to app-res-values->styles.xml then; Change,

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 

to

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">

this worked for me.

Upvotes: 9

Duncan Lukkenaer
Duncan Lukkenaer

Reputation: 13914

In my situation there was a silent error in my activity .xml file.

I accidentally positioned an item outside of my GridLayout (the child's layout_row/layout_column was too high). I'd expect Android Studio to report mistakes like this, but instead the design view just stops working.

So if your design view stops working and the other answers don't help, you might have an unreported error in your .xml file.

Upvotes: 1

Daniel
Daniel

Reputation: 2288

Steps

  1. Clean project

  2. Build project

  3. Close .xml files

  4. Reopen them

That worked for me

  1. Close android studio and reopen. Then rebuild project.

Upvotes: 1

Christina
Christina

Reputation: 1920

I just upgraded to Android Studio 1.5 and I ran into this same issue with new created projects. I tried invalidate the cache and rebuild the project. Sometimes that will fix the initial rendering, but any changes I make to the layout will not be reflected on the Design view.

The problem seems to be related to the embedded layout mechanism. After creating a new project (with Blank Activity), I got content_main.xml to display by removing the line tools:showIn="@layout/activity_main". Similarly, remove <include layout="@layout/content_main"/> from activity_main.xml and the Design view should render properly.

Upvotes: 4

Alex Maddyson
Alex Maddyson

Reputation: 411

Did you try to remove android studio cache folders after uninstalling? they located on
C:\Users\<username>\.android, ..\.AndroidStudio1.4, ..\.gradle.
And then try to install studio again

Upvotes: 2

compman2408
compman2408

Reputation: 2509

Try just building the project: Build -> Make Project

If that doesn't work try cleaning the project: Build -> Clean Project

That happened to me as well and all I had to do was build the project. Then it was able to render it.

Upvotes: 9

Related Questions