眼看日志消息:"应用:主题是德precated"? [英] Seeing message in logs: "app:theme is deprecated"?

查看:657
本文介绍了眼看日志消息:"应用:主题是德precated"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从升级到最新的应用程序兼容性库,我在我的日志中看到一条消息,从ViewUtils。

Ever since upgrading to the latest appcompat library, I'm seeing a message in my logs from ViewUtils.

应用程序:主题现在是很precated。请搬到采用了android:主题而不是

我用父=Theme.AppCompat.Light.NoActionBar我的主题父。

推荐答案

替换应用:主题安卓主题:>,但您可以在不使用应用程序有一个情况。检查你的布局,尤其是工具栏布局。对我来说,我没有应用:主题在我的布局文件。然后,在我的情况来看看:

Replace app:theme to android:theme but you can have a situation when you are not using app:theme. Check your layout, especially toolbar layout. In my case, I didn't have app:theme in my layout files. Then take a look at my situation:

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:styled="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar_actionbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:minHeight="?attr/actionBarSize"
    styled:popupTheme="@style/ToolbarDarkPopup"
    styled:theme="@style/ActionBarThemeOverlay" />

和我已经改变了这种布局:

And I've changed this layout to:

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toolbar_actionbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:minHeight="?attr/actionBarSize"
    android:theme="@style/ActionBarThemeOverlay" />

现在我没有看到警告。

看看这里也:
<一href=\"https://chris.banes.me/2015/04/22/support-libraries-v22-1-0/\">https://chris.banes.me/2015/04/22/support-libraries-v22-1-0/

由克里斯·巴内斯很好的解释

Great explanation by Chris Banes

这篇关于眼看日志消息:&QUOT;应用:主题是德precated&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆