`
takurachin
  • 浏览: 8234 次
社区版块
存档分类
最新评论

alertDialog设置主题theme的方法

阅读更多

 

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

 

 

 

resources中定义

 

<?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>   
 

 

分享到:
评论
1 楼 337240552 2012-06-29  
4.0不管用

相关推荐

    自定义主题改变AlertDialog样式

    通过自定义style改变framework原生AlertDialog样式,包括背景图片、按扭图片、标题样式、标题栏下方分割线颜色、按扭图片、按钮间分隔线等等。好多天的沤血作品,请大家勿喷。

    AlertDialogPro:[不建议使用]此项目可以使主题和自定义Android对话框变得容易。 还提供了适用于旧设备的Holo和Material主题

    为Android的AlertDialog设置主题并非易事。 因为它的某些属性在旧平台上不可用。 即使是较新的版本,您仍然不能使用android:layout来指定自己的布局,因为视图的ID应该与Android的ID保持一致,其中有些是不公开的。...

    DatePickerDialog 自定义样式及使用全解

    若低版本的则主题设置为以下 android:theme=”@android:style/Theme.Light.NoTitleBar” 效果:   2.新建DatePickerDialog DatePickerDialog datePicker = new DatePickerDialog(MainActivity.this, AlertDialog....

    Android去除AlertDialog的按钮栏的分隔线

    在网上学习了一种继承系统AlertDialog然后用一统一方法控制dialog显示的方法,效果还不错,但按钮栏那里的分隔线并不是想要的。于是去查看sdk中的AlertDialog的xml文件中的布局,发现其中并没有这一分隔线的影子,...

    AlertDialogPro-holo和material 两种风格的对话框.zip

    3.Material风格的dialog包含Theme.AlertDialogPro.Material 和Theme.AlertDialogPro.Material.Light 两种风格,使用方法和上面的holo差不多,但是需要AppCompat-v21的支持。4.自定义如果其中某一种风格符合你的绝大...

    Google.Android.SDK开发范例大全

     3.21 Android变脸——主题(Theme)实现  第4章 史上超豪华的手机控件  第5章 交互式通信服务与手机控制  第6章 手机自动服务纪实  第7章 娱乐多媒体  第8章 当Android与Internet接轨  第9章 Google...

    Google Android SDK开发范例大全 源码

     3.21 Android变脸——主题(Theme)实现  第4章 史上超豪华的手机控件  第5章 交互式通信服务与手机控制  第6章 手机自动服务纪实  第7章 娱乐多媒体  第8章 当Android与Internet接轨  第9章 Google...

    android app安卓开发教程之27个小例子附源代码.zip

    android app安卓开发教程之27个小例子附源代码.zip alertDialog animation audio broadcast Bundle 数据库 下载文件 draw expandableList ...theme 界面APP主题 touch upload上传文件 WeatherForecast

    Android典型技术模块开发详解

    9.1.2 主题Theme 9.2 View的绘制 9.3 Tween Animation 9.3.1 Alpha动画 9.3.2 Scale动画 9.3.3 Translate动画 9.3.4 Rotate动画 9.4 Frame Animation 9.5 动画组件——ViewAnimator 9.5.1 ViewSwitcher 9.5.2 ...

    Google Android SDK开发范例大全(PDF高清完整版3)(4-3)

    3.21 Android变脸——主题(Theme)实现 第4章 史上超豪华的手机控件 4.1 EditText与TextView共舞——setOnKeyListener事件 4.2 设计具有背景图的按钮——ImageButton的焦点及事件处理 4.3 给耶诞老人的信息——Toast...

    Google Android SDK开发范例大全(PDF完整版4)(4-4)

    3.21 Android变脸——主题(Theme)实现 第4章 史上超豪华的手机控件 4.1 EditText与TextView共舞——setOnKeyListener事件 4.2 设计具有背景图的按钮——ImageButton的焦点及事件处理 4.3 给耶诞老人的信息——Toast...

    Google Android SDK开发范例大全(PDF高清完整版1)(4-1)

    3.21 Android变脸——主题(Theme)实现 第4章 史上超豪华的手机控件 4.1 EditText与TextView共舞——setOnKeyListener事件 4.2 设计具有背景图的按钮——ImageButton的焦点及事件处理 4.3 给耶诞老人的信息——Toast...

    Google Android SDK开发范例大全的目录

    3.21 Android变脸——主题(Theme)实现 第4章 史上超豪华的手机控件 4.1 EditText与TextView共舞——setOnKeyListener事件 4.2 设计具有背景图的按钮——ImageButton的焦点及事件处理 4.3 给耶诞老人的信息——Toast...

    Google+Android+SDK开发范例大全

    ——具选择功能的对话框 3.21 Android变脸——主题(Theme)实现 第4章 史上超豪华的手机控件 4.1 EditText与TextView共舞——setOnKeyListener事件 4.2 设计具有背景图的按钮——ImageButton的焦点及事件处理 4.3 给...

    Google Android SDK开发范例大全(完整版附部分源码).pdf

    3.21 Android变脸——主题(Theme)实现 第4章 史上超豪华的手机控件 4.1 EditText与TextView共舞——setOnKeyListener事件 4.2 设计具有背景图的按钮——ImageButton的焦点及事件处理 4.3 给耶诞老人的信息——...

    Google Android sdk 开发范例大全 部分章节代码

    3.21 Android变脸——主题(Theme)实现 第4章 史上超豪华的手机控件 4.1 EditText与TextView共舞——setOnKeyListener事件 4.2 设计具有背景图的按钮——ImageButton的焦点及事件处理 4.3 给耶诞老人的信息——Toast...

    Google Android SDK 开发范例大全01

    3.21 Android变脸——主题(Theme)实现 第4章 史上超豪华的手机控件 4.1 EditText与TextView共舞——setOnKeyListener事件 4.2 设计具有背景图的按钮——ImageButton的焦点及事件处理 4.3 给耶诞老人的信息——Toast...

    Google Android SDK 开发范例大全02

    3.21 Android变脸——主题(Theme)实现 第4章 史上超豪华的手机控件 4.1 EditText与TextView共舞——setOnKeyListener事件 4.2 设计具有背景图的按钮——ImageButton的焦点及事件处理 4.3 给耶诞老人的信息——Toast...

Global site tag (gtag.js) - Google Analytics