Я хочу настроить нижний колонтитул AlertDialog, я имею в виду место, где расположены кнопки.
Я пытался создать отдельный макет и накачать его перед вызовом builder = AlertDialog.Builder();
вот так:
AlertDialog.Builder builder;
AlertDialog alertDialog;
Context mContext = activity;
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(mContext.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.customdialog, (ViewGroup) activity.findViewById(R.id.layout_root));
TextView dialogTitle = (TextView) layout.findViewById(R.id.dilaogTitle);
dialogTitle.setText("Alert Dialog Test");
TextView closeConfirmationQuestion = (TextView) layout.findViewById(R.id.textview);
closeConfirmationQuestion.setText("Test for AlertDialog");
builder = new AlertDialog.Builder(activity).setCancelable(false).setPositiveButton("Yes"), new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
//Do something
}
}).setNegativeButton("No"), new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
dialog.cancel();
}
});
builder.setView(layout);
alertDialog = builder.create();
alertDialog.setView(layout, 0, 0, -3, -3);
alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
alertDialog.show();
Но я мог настроить только содержимое моего AlertDialog, но не нижний колонтитул и кнопки.Вот как это выглядит:
Мне нужно знать, как настроить кнопки и их держатель, я имею в виду нижний колонтитул AlertDialog, возможно, поставить цвет или изображение какего фон вместо стандартного «серого» цвета, а также установите настраиваемый фон для кнопок.
Спасибо.