我在Android Studio上的设计视图是空白的.它没有改变.我也试过与gradle build同步.该怎么办?

Nik*_*ary 5 xml android

在此输入图像描述

XML代码:

<?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
Run Code Online (Sandbox Code Playgroud)

需要帮助asap.怎么办?

Pra*_* GM 5

更新android studio后我昨天遇到了同样的问题,转到Gradle Scripts - > Build.Gradle(Module:app)

摇篮

将alpha3更改为alpha1

        implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
Run Code Online (Sandbox Code Playgroud)

        implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
Run Code Online (Sandbox Code Playgroud)

图片


小智 -2

使用这段代码,它工作正常:

<?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>
Run Code Online (Sandbox Code Playgroud)