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'
你不必'AppTheme.AppBarLayout'在你的風格。我想你必須將它改成'AppTheme.AppBarOverlay' – SripadRaj
將改成 – DkThakur
對不起。我得到了我所犯的錯誤。請忽略 – Shekar