How to use and style new AlertDialog from appCompat 22.1 and above
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to migrate from default android AlertDialog to the new one included in appCompat-22.1 So far I understand you only have to import android.support.v7.app.AlertDialog package in order to use it. But how can I style it? For example change the positive/negative button colors, title color, message color and background color? 回答1: When creating the AlertDialog you can set a theme to use. Example - Creating the Dialog AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.MyAlertDialogStyle); builder.setTitle(