Custom Dialog without title and border

后端 未结 8 896
终归单人心
终归单人心 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:06

    I use this code and it work fine:

    AlertDialog.Builder builder = new AlertDialog.Builder(contextActivity,android.R.style.Theme_Holo_Dialog_NoActionBar);
    AlertDialog alertDialog = builder.create();
    alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    alertDialog.setView(myLayout,0,0,0,0);
    alertDialog.show();
    

提交回复
热议问题