Android Studio将控件显示为文本

时间:2019-06-17 07:51:05

标签: java android xml

即使我在build.gradle文件中添加了Android Studio,Android Studio也无法正确显示“ com.android.support:support-v4:28.0.0”中的控件

我已经尝试将styles.xml中的AppTheme设置为“ Base.Theme.AppCompat.Light.DarkActionBar”,并尝试了多次重建

<android.support.v4.widget.DrawerLayout 
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"
android:orientation="vertical"/>

此处“ android.support.v4.widget.DrawerLayout”在预览中仅显示为android.support.v4.widget.DrawerLayout

[这就是预览中显示的内容] [1]

a busy cat

这是我的 gradle.build 文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.alto.alizer.altovpn"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            minifyEnabled true
            shrinkResources false
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'

    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

0 个答案:

没有答案