WannaInternet
WannaInternet

Reputation: 424

Android Studio: Nothing is showing up on my preview xml page

Whenever I go to the design tab of an XML file, the preview is completely blank. Even when I try to put components it does not visually show up. Below is a link to an example.

I tried to resync with Gradle files, invalidate catches and restart and even reinstalled Android Studios, but nothing works.

What should I do?

Totally blank preview

Edit: Somehow by changing the api values next to AppTheme on top it works. But it leads to another problem: none of the attributes are showing up. Is there another fix to this? I tried another invalidate and restart with no success.

Attribute side is completely blank

Upvotes: 0

Views: 231

Answers (4)

nidhi
nidhi

Reputation: 337

Check the theme you have selected is right or not. In my case i solved the issue by changing the theme by noactionbar that I have used in menifest for this activity.

Upvotes: 0

Muhammad Ashfaq
Muhammad Ashfaq

Reputation: 2521

if you are using build gradle version 28,

in build.gradle file depencies using "28.0.0"

just change it to

28.0.0-alpha1

it wil solve the problem hopefully.

Upvotes: 1

Prashant singh
Prashant singh

Reputation: 113

Just go to styles.xml and change this:

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

to

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

Hope it will help.

Upvotes: 0

Andr&#233; Sousa
Andr&#233; Sousa

Reputation: 1730

Solution

Please check if in your project is using any support library that is RC or beta. If you are using an RC or beta, try a downgrade.

Another thing you could try is to downgrade also your compileSdkVersion and targetSdkVersion and rebuild your project.

Hope it helps.

Upvotes: 0

Related Questions