Android: Custom Title Bar

后端 未结 5 1516
失恋的感觉
失恋的感觉 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:20

    you should also check whether customTitle is supported by it or not.

    Boolean customTitleSupported = requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
            setContentView(R.layout.main);
    
    
    
    if (customTitleSupported) {
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title);
    
    }
    

提交回复
热议问题