Menu
Who Do Is
  • Home
  • What
  • How
  • Is
  • Can
  • Are
  • Does
  • Do
  • Why
  • Who
  • Where
  • Which
  • Which
  • Should
  • Will
  • When
  • What’s
  • Did
Who Do Is

[ANSWERED] android – Attributes are ignored in my app theme (style)

Posted on November 14, 2022

Solution 1 :

Do you have AppTheme only in values/styles.xml? Maybe do you have values-v21/styles.xml that contains AppTheme also so the problem is there or something like this?

Problem :

I have base theme

<style name="BaseAppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
    <item name="colorPrimary">@color/color_primary</item>
    ...
</style>

and AppTheme that inherits it

<style name="AppTheme" parent="BaseAppTheme" >
    <item name="colorPrimary">#FFFF0000</item>
    <item name="android:statusBarColor">@color/transparent</item>
</style>

and is used as the main theme of the app, i.e.

<application
...
    android_theme="@style/AppTheme"
... 
    >
    <activity
        android_name=".MainActivity"
        android_theme="@style/AppTheme"/>
</application>

The problem is that attributes (eg <item name="colorPrimary">#FFFF0000</item> or <item name="android:statusBarColor">@color/transparent</item>, all of them) in AppTheme are ignored. However, if I add them to BaseAppTheme then they will work. Why are attributes ignored in AppTheme and how to fix it?

Comments

Comment posted by Rajnish Sharma

I tried the same and it is working fine! Try with some other color in statusBarColor! I tried with #C51D1D and works well!

Comment posted by Andriy D.

@IR42 Maybe you use the BaseAppTheme somewhere, e.g. in

Comment posted by Rajnish Sharma

Try rebilding and clearing your cache, your problem might be from there!

Comment posted by Rajnish Sharma

Can you show the manifest file if your problem still persists? if not then you can mark my answer correct!

Comment posted by IR42

@AndriyD. i realized i added attrs to

Comment posted by Hiro

Yup. That was it. This is madness. You’d naturally think the suffixed versions inherit and overwrite from the non-suffixed one.

READ  [ANSWERED] android - How do I convert this time format into epoch in java? "Tue Dec 28 16:55:00 GMT+05:30 2021" to Epoch
Powered by Inline Related Posts

Recent Posts

  • How can I play with my cat without toys?
  • What is a bag pipe band called?
  • Are Honda Civics actually fast?
  • Are Yankee candles toxic?
  • How do I pair my Michael Kors smartwatch with my Android?

Recent Comments

No comments to show.

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuántas
  • ¿Cuánto
  • ¿Que
  • ¿Quién
  • 90” and 108” so you may have to round up to the nearest size.
  • and delete any Spotify folders from it. Once this is done
  • Android
  • Are
  • At
  • Bei
  • blink
  • C'est
  • Can
  • carbs
  • Comment
  • Did
  • Do
  • Does
  • During
  • For
  • Has
  • How
  • In
  • Is
  • Ist
  • Kann
  • Können
  • nouveau
  • On
  • or 108 inches.2020-08-03
  • Où
  • owning
  • Pourquoi
  • Puis-je
  • Quand
  • Quante
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • spiritual
  • tap the downward-facing arrow on the top left. A downward-facing arrow will appear underneath each song in the album; they'll turn green as the download completes.2020-07-28
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welcher
  • Welches
  • Welke
  • Wer
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Whose
  • Why
  • Wie
  • Will
  • Wo
  • Woher
  • you will receive two curtains each with the same measurements of width 66"" (168cm) x drop 54""(137cm).
  • you'll see a green downward-facing arrow next to each song.2021-02-26
©2023 Who Do Is | Powered by SuperbThemes & WordPress