Nikhil Chaudhary
Nikhil Chaudhary

Reputation: 51

My design view on Android Studio is blank. It doesn't change. I have tried syncing with gradle build too. What to do?

enter image description here

XML CODE:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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">

<TextView
    android:layout_width="34dp"
    android:layout_height="53dp"
    android:text="Hello World!"
    android:textAppearance="@style/TextAppearance.AppCompat"
    android:visibility="visible" />

</LinearLayout

Need help asap.What to do??

Upvotes: 5

Views: 1400

Answers (3)

Praveen G
Praveen G

Reputation: 984

I had the same problem yesterday after updating android studio, Go to Gradle Scripts -> Build.Gradle(Module:app)

Gradle

change alpha3 to alpha1

        implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'

to

        implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'

Image

Note: [Edit] This solution doesn't work anymore as version codes have been updated, stable version has been released

Upvotes: 3

Dnyaneshwar Panchal
Dnyaneshwar Panchal

Reputation: 444

Just building the project: Build -> Make Project

If that doesn't work try cleaning the project: Build -> Rebuild and 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: 1

Hemant N. Karmur
Hemant N. Karmur

Reputation: 880

Use this code, it's working fine:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="34dp"
        android:layout_height="53dp"
        android:text="Hello World!"
        android:textAppearance="@style/TextAppearance.AppCompat"
        android:visibility="visible" />

</LinearLayout>

Upvotes: -2

Related Questions