Я пытаюсь изменить цвет кнопки AlertDialog.Builder, но я не нашел способа сделать это.
Я хочу изменить цвет кнопок и заголовка на белый, как в теме HOLO.
см. эти 2 скриншота в качестве примеров:
Я смотрел сюда:
Как изменить тему для AlertDialog
Как изменить фон диалогового окна настраиваемого предупреждения а>
Все они у меня не работают.
Вот мой код:
public void logInDialog()
{
ContextThemeWrapper ctw = new ContextThemeWrapper( this, R.style.dialogStyle);
AlertDialog.Builder builder = new AlertDialog.Builder(ctw);
builder.setTitle("Log in");
View prefView = View.inflate(this, R.layout.log_in, null);
//The rest of the code.........
}
Это мой код стиля:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="dialogStyle" parent="android:Theme.Dialog">
<item name="android:background">@color/white</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:button">@color/white</item>
</style>
</resources>