Yar*_*ron 6 android android-theme android-studio
我是android studio的新手,我安装了新版本(版本1.5.1).出于某种原因,我不断收到错误消息(每次我使用应用程序主题)时都说有渲染问题:缺少样式.我在网上寻找解决方案,但大多数已经过时或者根本不工作.
谢谢你的帮助.
清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.easycodingplus.myapplication">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
建立gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.easycodingplus.myapplication"
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
Run Code Online (Sandbox Code Playgroud)
请确保您在 build.gradle 文件中将最新的 AppCompat 库列为依赖项:
com.android.support:appcompat-v7:23.1.0
您能发布错误指的是哪种样式吗?您可能需要将样式添加到 res > value > styles 文件夹中。您的代码中的某些内容可能引用了该文件夹中不存在的样式。
| 归档时间: |
|
| 查看次数: |
4459 次 |
| 最近记录: |