会员登录
AlertDialog字体大小设置
来源:查看 作者:未知 时间:2011-04-11 00:43:46 点击:108227 评论:5
本文地址:http://pslib.com/index.php?mod=skill&action=detail&id=44010 [复制]

In Dialog.java (Android src) a ContextThemeWrapper is used. So you could copy the idea and do something like:

AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AlertDialogCustom));

And then style it like you want:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AlertDialogCustom" parent="@android:style/AlertDialog">
<item name="android:textColor">#00FF00</item>
<item name="android:typeface">monospace</item>
<item name="android:textSize">10sp</item>
</style>
</resources>
最新评论
共有 5 位网友发表了评论