【发布时间】:2015-11-17 09:42:18
【问题描述】:
我想更改AlertDialog.Builder 对象的字体。我的 AlertBuilder 在 webview 内容中。这是我的代码:
webView.addJavascriptInterface(new Object() {
@JavascriptInterface // For API 17+
public void performClick(String strl) {
AlertDialog.Builder dialog = new AlertDialog.Builder(
new ContextThemeWrapper(FacebookSlider.this, R.style.AlertDialogCustom));
dialog.setMessage(strl);
dialog.show();
}
}, "ok");
我读过这个link,但它不适用于AlertDialog.Builder。我该怎么办?
【问题讨论】:
-
设置 TypeFace 时遇到的问题是什么,您是否在文件夹名称资产中提供了自定义字体
-
@L-X 6,将 TypeFace 设置为什么?
dialog.findViewById(android.R.id.message)在上述链接中的方法中不适用于AlertDialog.Builder设置字体。 -
您可以为此对话框使用自定义布局,并在自定义布局中更改 textView 的 TypeFace
标签: android font-face android-alertdialog