How to hide the title bar for an Activity in XML with existing custom theme

前端 未结 30 2218
误落风尘
误落风尘 2020-11-22 03:28

I want to hide the titlebar for some of my activities. The problem is that I applied a style to all my activities, therefore I can\'t simply set the theme to @android:

30条回答
  •  生来不讨喜
    2020-11-22 03:41

    If you use this.requestWindowFeature(Window.FEATURE_NO_TITLE) user will still be able to see the title bar just for a moment during launch animation when activity starts through onCreate. If you use @android:style/Theme.Black.NoTitleBar as shown below then title bar won't be shown during launch animation.

    
    

    above example will obviously override your existing application theme, if you have existing theme then add true to it.

提交回复
热议问题