java - android studio 将控件显示为文本
问题描述
即使我在 build.gradle 文件中添加了来自 'com.android.support:support-v4:28.0.0' 的控件,Android Studio 也没有正确显示
我已经尝试将我的 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]
这是我的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'
}
解决方案
推荐阅读
- reactjs - 按下卡片按钮时,应该直接到新页面以使用 React 路由器显示一些信息:路由器、链接、路由
- php - 数据库连接函数调用的以下代码出错
- css - css中div上的消息点尾
- nginx - 如何在 Nginx 真实服务器上运行 laravel websocket
- excel - 使用索引匹配功能但未获得所需结果
- c++ - 谁能给我解释一下?
- python-3.x - 如何搜索特定字符串并替换此字符串usign python中的数字?
- cmd - 如何解决命令提示符中的“Make clean”错误
- r - 网页抓取:R rvest html_nodes 返回字符(0)
- python-3.x - 如何仅使用 while 循环在第二小的数字旁边输出名称