The following classes could not be found: android.support.v7.internal.app.WindowDecorActionBar

来源:互联网 发布:appstore下载不了软件 编辑:程序博客网 时间:2024/06/05 06:51

<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">解决办法,有两种:一个是在styles.xml中修改parent;二是在界面xml中去增加toolbar.</span>

出现这个问题是原因是, 在使用默认创建的activity时,用了'com.android.support:appcompat-v7:23.1.1',没有在界面xml中去使用toolbar,于是弹出这个警告,告诉你接下来可以去使用actionbar。


那么接下来解决它,第一种,使用actionbar:

1.打开styles.xml。

2.修改parent属性,

parent="Base.Theme.AppCompat.Light.DarkActionBar"
二是在界面xml中去增加toolbar:
<android.support.design.widget.AppBarLayout        android:id="@+id/app_bar"        android:layout_width="match_parent"        android:layout_height="@dimen/app_bar_height"        android:fitsSystemWindows="true"        android:theme="@style/AppTheme.AppBarOverlay">        <android.support.design.widget.CollapsingToolbarLayout            android:id="@+id/toolbar_layout"            android:layout_width="match_parent"            android:layout_height="match_parent"            android:fitsSystemWindows="true"            app:contentScrim="?attr/colorPrimary"            app:layout_scrollFlags="scroll|exitUntilCollapsed">            <android.support.v7.widget.Toolbar                android:id="@+id/toolbar"                android:layout_width="match_parent"                android:layout_height="?attr/actionBarSize"                app:layout_collapseMode="pin"                app:popupTheme="@style/AppTheme.PopupOverlay" />        </android.support.design.widget.CollapsingToolbarLayout>    </android.support.design.widget.AppBarLayout>



0 0