0
我做了使用alertDialog Builder和asigned佈局,以這樣的:如何使用「wrap_content」佈局來檢索alertDialog的高度?
View view2 = LayoutInflater.from(getContext()).inflate(R.layout.information_dialog_layout, null);
AlertDialog alertDialog = new AlertDialog.Builder(getContext(), R.style.ert).create();
alertDialog.setView(view2);
alertDialog.show();
,但將無法獲取在像素對話框高度,tryed「矩形」類,以及,但沒有幫助(可設置一個錯誤雖然)...? P.S我查閱了一些答案在這裏在計算器上類似的問題,但沒有對我的工作的:■
其實'view2.getMeasuredHeight()'應該工作** **後顯示對話框。 –
它沒有 - 獲得「0」:s – pb4now
@SakchhamSharma答案有沒有例子,其中U使用Builder – pb4now