File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -641,6 +641,22 @@ API level>=17,允许js 被调用的函数必须以@JavascriptInterface 进行
641641
642642```
643643
644+ * 如何动态修改AlertDialog的Button样式,
645+ ```
646+ //监听Dialog的setOnShowListener方法
647+ dialog.setOnShowListener(new DialogInterface.OnShowListener() {
648+ @Override
649+ public void onShow(final DialogInterface dialog) {
650+ Button negativeButton = ((AlertDialog)dialog).getButton(DialogInterface.BUTTON_NEGATIVE);
651+ Button positiveButton = ((AlertDialog)dialog).getButton(DialogInterface.BUTTON_POSITIVE);
652+ negativeButton.invalidate();
653+ positiveButton.invalidate();
654+ }
655+ });
656+ dialog.show();
657+
658+ ```
659+
644660
645661
646662#### 摘自[ 如下地址] ( https://github.com/jiang111/awesome-android-tips/blob/master/Authors.md )
You can’t perform that action at this time.
0 commit comments