Android activity as dialog, but without a title bar

后端 未结 9 1814
暗喜
暗喜 2020-12-02 21:59

I have an activity that has the following set as theme:

android:theme=\"@android:style/Theme.Dialog\"

However, there is a title bar in the

9条回答
  •  借酒劲吻你
    2020-12-02 22:32

    If you are using AppCompatActivity requestWindowFeature(Window.FEATURE_NO_TITLE) is not working.

    for this you can create custom theme in values/style.xml as below:

       
    

    please note that item name:"windowNoTitle" not item name:"android:windowNoTitle"

    In menifest.xml apply this custom theme as

    
    

    or you can use getSupportActionBar().hide() to programmatically hide action bar.

提交回复
热议问题