我有一个奇怪的问题,我的“警告对话框”开始看起来像这样: 我
我不知道为什么-在以前的版本中它们看起来很正常-没有这种奇怪的,宽阔的黑框。如何改变呢? 我的风格代码:
<style name="AlertDialogStyle" parent="Base.Theme.AppCompat.Dialog.Alert"> <!-- This theme has black settings icons -->
<item name="colorPrimary">@color/app_mint</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/blackColor</item>
<item name="android:windowBackground">@color/whiteColor</item>
<item name="android:background">@color/app_main_color</item>
<item name="android:fontFamily">@font/dosis_light</item>
<!-- active thumb & track color (30% transparency) -->
<item name="colorControlActivated">#46bdbf</item>
<item name="android:titleTextStyle">@style/eventInfoTextLarge</item>
<!-- inactive thumb color -->
<item name="colorSwitchThumbNormal">#f1f1f1</item>
<!-- inactive track color (30% transparency) -->
<item name="android:colorForeground">#42221f1f</item>
<item name="android:textColorPrimary">@color/blackColor</item>
</style>
活动代码:
private void showDeleteConfirmationDialog() {
// Create an AlertDialog.Builder and set the message, and click listeners
// for the positive and negative buttons on the dialog.
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AlertDialogStyle);
builder.setMessage(livewind.example.andro.liveWind.R.string.delete_dialog_msg);
builder.setPositiveButton(livewind.example.andro.liveWind.R.string.delete, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Windsurfer clicked the "Delete" button, so delete the event and remove 5 points.
deleteEvent();
}
});
builder.setNegativeButton(livewind.example.andro.liveWind.R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Windsurfer clicked the "Cancel" button, so dismiss the dialog
// and continue editing.
if (dialog != null) {
dialog.dismiss();
}
}
});
// Create and show the AlertDialog
AlertDialog alertDialog = builder.create();
alertDialog.show();
}
感谢您的帮助。