app:主题现已弃用

时间:2015-07-11 11:45:03

标签: android styles themes android-appcompat

我从昨天开始使用android非常好,但今天当我通过intellijIDEA运行我的应用程序时,它给了我:

I/AppCompatViewInflater﹕ app:theme is now deprecated. Please move to using android:theme instead.

我的风格是:

    <resources>

    <style name="AppTheme" parent="Theme.Base">

    </style>

    <style name="Theme.Base" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
</resources>

问题是什么,我该如何解决?

提前感谢,

更新:我的toolbar.xml文件是:

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
                               xmlns:local="http://schemas.android.com/apk/res-auto"
                               android:id="@+id/toolbar"
                               android:layout_width="match_parent"
                               android:layout_height="wrap_content"
                               android:minHeight="?attr/actionBarSize"
                               android:background="?attr/colorPrimary"
                               local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
                               local:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

android sdk工具:24.3.3

android sdk构建工具:22

android支持库:22.2

1 个答案:

答案 0 :(得分:5)

尝试

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar 
           xmlns:android="http://schemas.android.com/apk/res/android"
           xmlns:local="http://schemas.android.com/apk/res-auto"
           android:id="@+id/toolbar"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:minHeight="?attr/actionBarSize"
           android:background="?attr/colorPrimary"
           android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
          />
相关问题