Учитывая функциюИзменения цвета кнопки в AlertDialog.Builder
private void showInputDialog() {
final AlertDialog.Builder alert = new AlertDialog.Builder(getActivity());
final EditText input = new EditText(getActivity());
input.setSingleLine();
FrameLayout container = new FrameLayout(getActivity());
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params.leftMargin= convertDpToPx(25); //remember to scale correctly
params.rightMargin= convertDpToPx(30);
input.setLayoutParams(params);
container.addView(input);
alert.setTitle("Change City");
alert.setMessage("Hey there, could not find the city you wanted. Please enter a new one:\n");
alert.setView(container);
alert.setPositiveButton("Go", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
changeCity(input.getText().toString());
}
});
alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
alert.show();
}
Теперь, когда я получаю эту AlertDialog.Builder в моем приложении, кнопка цвет зеленый (по умолчанию от Android 5), но цвет EditText Розовый (R.color.coloraccent). Как изменить цвет кнопок на розовый?
Любая помощь будет оценена
установить стиль в alerdialog. –