Android: Custom Title Bar

后端 未结 5 1578
失恋的感觉
失恋的感觉 2020-11-28 11:08

I have a custom title bar

 requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
 setContentView(R.layout.activities);
 getWindow().setFeatureInt(Window.FEATURE         


        
5条回答
  •  臣服心动
    2020-11-28 11:28

    First thing why are you using a custom title bar if your app has NoTitleBar? That is silly!

    Needless to say, this is your problem and you must remove that flag.

    Anyhow, the best way to add custom title bar is in xml only. This avoids your app double loading the title bar; which users will see.

    ../res/styles.xml

    
    
       
    
    
    

    Then you dont need that code about requestAnything.

提交回复
热议问题