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

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

    First answer is amphibole. here is my explain: add:

    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN);
    

    in oncreate() method.

    before:

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_start);
    

    (not just before setContentView) if don't do this u will get forceclose. +1 this answer.

提交回复
热议问题