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

Categories

I'm using Theme.MaterialComponents.DayNight.NoActionBar for my activity. My goal is to create an activity with no title bar and make the notification bar background as same as app background colour. Everything works fine under normal condition. But when I enable dark theme from the device settings, the title bar suddenly appears. How can I get rid of title bar for both dark light theme?

question from:https://stackoverflow.com/questions/66059439/how-to-hide-android-title-bar-in-dark-mode

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

By default in the themes folder, there will be a normal one and night version change the parent theme in both to parent="Theme.MaterialComponents.DayNight.NoActionBar" like below image

and the theme in manifest to style name in these two themes(same name) for me here android:theme="@style/Theme.Advice"> in manifest

image image

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...