Output: error: resource style/TextAppearance.Compat.Notification.Info (aka package_name:style/TextAppearance.Compat.Notification.Info) not found

前端 未结 2 506
后悔当初
后悔当初 2021-01-17 13:29

After switching to Android Studio 3.2 canary I am getting the following build error.

I have seen this post where the guy had a similar issue but no

相关标签:
2条回答
  • 2021-01-17 13:56

    for my self this happened after migrating to AndroidX, I changed style="@style/TextAppearance.AppCompat.Notification.Info" to style="@style/TextAppearance.AppCompat.Title" and the output of the view is fine at least for me. I didn't find any difference as before AndroidX.

    You can consider my solution as a workaround till you test it.

    0 讨论(0)
  • 2021-01-17 13:59

    I think you should try adding style as below in your styles.xml file. For me it worked perfectly, for the similar kind of issue.

    <style name="TextAppearance.AppCompat.Notification">
        <item name="android:textSize">12sp</item>
        <item name="android:textColor">?android:attr/textColorWhichYouWant</item>
    </style>
    

    Or you can use @style/TextAppearance.AppCompat.Notification with TextView in XML file:

    <TextView
        android:id="@+id/tvNotification"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:maxLines="1"
        android:text="Test notification"
        android:textAppearance="@style/TextAppearance.AppCompat.Notification" />
    

    Please check this link, You can create your custom notification layout.

    0 讨论(0)
提交回复
热议问题