How to add title to the custom Dialog?

后端 未结 7 740
猫巷女王i
猫巷女王i 2021-01-12 20:37

How can i add title to this custom dialog??

\"enter

I have tried like this

7条回答
  •  我在风中等你
    2021-01-12 21:28

    Using some of your snippet:

    public void customDialog() {
        Dialog dialog=new Dialog(this);
        dialog.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        dialog.setContentView(R.layout.dialog_submit);
        dialog.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);
        dialog.show();
    }
    

    res/layout/custom_title.xml

    
    

提交回复
热议问题