2017-03-22 9 views
3

首先让我告诉你我是新来的网站。有关发布的任何问题,请原谅。我曾经从这个网站上找到解决方案来解决问题。但在这里我陷入了困境。我做了很多搜索,我试图用提供的解决方案来解决它,但问题仍然存在。请帮帮我。找不到与指定名称相匹配的资源(在'主题'中输入值'@ style/AppTheme.AppBarLayout')

下面是代码

布局文件

<android.support.design.widget.CoordinatorLayout 
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:fitsSystemWindows="true" 
tools:context="com.example.user.securedata.DataProtectionSelective"> 

<android.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/AppTheme.AppBarLayout"> 

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     android:background="?attr/colorPrimary" 
     app:popupTheme="@style/AppTheme.PopupOverlay" /> 

</android.support.design.widget.AppBarLayout> 

<include layout="@layout/content_main" /> 

<android.support.design.widget.FloatingActionButton 
    android:id="@+id/fab" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="bottom|end" 
    android:layout_margin="@dimen/fab_margin" 
    android:src="@android:drawable/ic_dialog_email" /> 

</android.support.design.widget.CoordinatorLayout> 

styles.xml

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> 
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> 

的build.gradle

compile 'com.android.support:appcompat-v7:25.1.0' 
compile 'com.google.code.gson:gson:2.2.4' 
compile 'com.squareup.picasso:picasso:2.3.2' 
compile 'com.android.support:recyclerview-v7:25.1.0' 
compile 'com.android.support:design:25.1.0' 
+2

你不必'AppTheme.AppBarLayout'在你的风格。我想你必须将它改成'AppTheme.AppBarOverlay' – SripadRaj

+0