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

前端 未结 30 1693
误落风尘
误落风尘 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:47

    when i tried to use all those high upvoted answers my app always crashed. (i think it has something to do with the "@android:style"?)

    The best solution for me was to use the following:

    android:theme="@style/Theme.AppCompat.NoActionBar"
    

    No header / title bar anymore. Just place it in the ... or ... depending if you (don't) want it in the whole app or just a specific activity.

提交回复
热议问题