Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
319 views
in Technique[技术] by (71.8m points)

android - Seeing message in logs: "app:theme is deprecated"?

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

app:theme is now deprecated. Please move to using android:theme instead.

I'm using parent="Theme.AppCompat.Light.NoActionBar" as my theme parent.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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" />

Now I don't see the warning.

Take a look also here: https://chris.banes.me/2015/04/22/support-libraries-v22-1-0/

Great explanation by Chris Banes


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...