您的位置:首页 > Web前端 > CSS

AlertDialog自定义样式

2011-10-02 01:08 357 查看
像列表这种选择项的弹出式对话框,要改变样式一般都采取重写layout方式

今天才了解到 其实可以自定义样式,与大家分享下,其实很简单

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


然后自定义自己的样式就可以了

<?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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: