【发布时间】:2015-10-23 08:25:22
【问题描述】:
我一直在使用 material design 开发一个应用程序。我对此完全陌生。我一直在寻找本教程以供参考 material design 。但是我没有在工具栏的右上角显示“设置”选项。工具栏正在显示,但不是“3 点设置”按钮。我遵循与教程相同的方法,但我不知道为什么没有显示设置。 这是我的 styles.xml 代码:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="AppTheme.Base">
<!-- Customize your theme here. -->
</style>
<style name="AppTheme.Base" parent="Theme.AppCompat.Light">
</style>
</resources>
和我的 styles.xml(v-21) 代码:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="AppTheme.Base">
</style>
我的 build.gradle 看起来像这样:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.0.1"
defaultConfig {
applicationId "app.xxx.yyy.myapplication"
minSdkVersion 15
targetSdkVersion 21
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:21.0.+'
}
【问题讨论】:
-
分享您的 MainActivity 代码。