새로운 레이아웃 파일을 확인하고 찾을 수 있습니다. 그런 다음 Android에 제공되는 기본 기능 대신 대화 상자에 새로운 용도를 추가 할 수 있습니다. 나를 위해
String[] p_values = populate_the_list_with_your_content();
ListView mListview = new ListView(this); // pass your context here
adpter = new ArrayAdapter<String>(this,R.layout.your_raw_item_with_whatever_you_like, p_values);
mListview.setAdapter(adpter);
AlertDialog mAlertDialog;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
AlertDialog.Builder mBuider = new AlertDialog.Builder(your_context);
mBuider.setTitle("title"); // optional
mBuider.setPositiveButton("positive", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// do what you got to do - just be positive
}
});
mBuider.setNegativeButton("Back",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// negative reaction
}
});
mBuider.setView(mListview);
mAlertDialog = mBuider.create();
lp.copyFrom(mAlertDialog.getWindow().getAttributes());
mAlertDialog.show();
작품 :
죄송합니다. 문제는 XMl이 모든 것을 가지고 있고 xml을 부 풀리고 setView에서 설정하는 문제입니다. –
@ Dheeresh Singh 설정하는 방법 간단한 예를 들어주십시오. 감사. –
'builder.show()'를 시도 했습니까? – overbet13