0
我試圖建立如下動態的警報對話框。一切工作正常。爲什麼alertbuilder對話框在拐角處有額外的黑色?
final Builder builder = new AlertDialog.Builder(context);
builder.setView(view);
builder.setCancelable(true);
builder.setOnCancelListener(new SortOnCancelListener(viewable, this));
dialog = builder.create();
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(dialog.getWindow().getAttributes());
DisplayMetrics displaymetrics = new DisplayMetrics();
((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
lp.width = (int) ((int)displaymetrics.widthPixels * 0.6);
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
dialog.show();
dialog.getWindow().setAttributes(lp);
請讓我知道我做錯了。
感謝, 沙拉斯
相信我會檢查,並讓你知道。謝謝 – coders
對話框打開時,背面模糊效果不會顯現。對此有何建議? – coders
檢查此:http://stackoverflow.com/questions/9632120/background-blur-while-using-dialog-box – Cliff