Custom Dialog without title and border

后端 未结 8 895
终归单人心
终归单人心 2021-02-01 20:19

Based on the code here, http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog . I am successfully able to create a custom dialog with background and buttons ins

8条回答
  •  滥情空心
    2021-02-01 21:04

    I think this will help you out

    gameOver would be the dialog name and in setContentView it would be ur custom dialog layout

    gameOver = new Dialog(Main.this);
    gameOver.requestWindowFeature(Window.FEATURE_NO_TITLE);
    gameOver.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    gameOver.setCancelable(false);
    gameOver.setContentView(R.layout.gameover);
    

提交回复
热议问题