2013年11月6日 星期三

Android Dialog no title, transparent background 無標題 背景透明

final Dialog dialog = new Dialog(your_context);

//設成無標題,此行要在setContentView之前
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

dialog.setContentView(R.layout.your_dialog_layout);

//設成背景透明
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));

沒有留言:

張貼留言