我要在使用AndroidStudio预览时使用Material.Light.Panel主题,但是在“选择主题”对话框中找不到。
我的build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
androidExtensions {
experimental = true
}
android {
compileSdkVersion 28
androidExtensions {
experimental = true
}
defaultConfig {
applicationId "com.dslx.electronicclassboard"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters "armeabi","armeabi-v7a"
}
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:recyclerview-v7:$support_version"
implementation "com.android.support:support-v4:$support_version"
implementation "com.android.support:design:$support_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
}
如何找到这个主题?
答案 0 :(得分:0)
主题不是在build.gradle中设置的,而是在res-> layout-> values
下的styles.xml文件中设置的 <style name="AppTheme" parent="Theme.AppCompat.Light"/>
您可以从此处在清单文件中设置应用的主题
android:theme="@style/AppTheme"
答案 1 :(得分:0)