Remove black background on custom dialog

前端 未结 13 2271
清歌不尽
清歌不尽 2021-01-30 20:54

I want to remove the black background on custom dialog as shown in the picture. I\'m sure the black background was from the dialog, not from app\'s background.

13条回答
  •  余生分开走
    2021-01-30 21:03

    you can create xml layout like following and set that layout on dialog(dialog.xml) :

    
    
    
        
    
            
        
    
    

    here is the code to set layout on alert dialog :

    AlertDialog alert = cndtnsbuilder.create();
    alert.setView(LayoutInflater.from(
    currentactivity.this).inflate(
    R.layout.dialog, null));
    alert.show();
    

提交回复
热议问题