有关style的查找
来源:互联网 发布:clip studio mac 破解 编辑:程序博客网 时间:2024/05/17 09:34
在源码中有如下AlertDialog
protected AlertDialog(Context context) { this(context, com.android.internal.R.style.Theme_Dialog_Alert); }
其中Theme_Dialog_Alert在哪里呢?
我们到res下面找到value里面的themes.xml里面的Theme_Dialog_Alert,但是这样是找不到的,需要把下划线"_"改成".",这样就ok了
<!-- Default theme for alert dialog windows, which is used by the {@link android.app.AlertDialog} class. This is basically a dialog but sets the background to empty so it can do two-tone backgrounds. --> <style name="Theme.Dialog.Alert"> <item name="windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="windowTitleStyle">@android:style/DialogWindowTitle</item> <item name="windowIsFloating">true</item> <item name="windowContentOverlay">@null</item> <item name="android:gravity">center</item> </style>
在AlertController中
TypedArray a = mContext.obtainStyledAttributes( null, com.android.internal.R.styleable.AlertDialog, com.android.internal.R.attr.alertDialogStyle, 0);
针对R.attr.alertDialogStyle
pateo@pateo-B86N53X:/work/project/f0400s/frameworks/base/core/res$ grep -r "alertDialogStyle" ././res/values/attrs.xml: <attr name="alertDialogStyle" format="reference" />./res/values/attrs.xml: <attr name="dlsalertDialogStyle" format="reference" />./res/values/public.xml: <public type="attr" name="alertDialogStyle" id="0x0101005d" />./res/values/themes.xml: <item name="alertDialogStyle">@android:style/AlertDialog</item>./res/values/themes.xml: <item name="dlsalertDialogStyle">@android:style/DlsAlertDialog</item>pateo@pateo-B86N53X:/work/project/f0400s/frameworks/base/core/res$ pateo@pateo-B86N53X:/work/project/f0400s/frameworks/base/core/res$
找到styles.xml文件里面的AlertDialog
<style name="AlertDialog"> <item name="fullDark">@android:drawable/popup_full_dark</item> <item name="topDark">@android:drawable/popup_top_dark</item> <item name="centerDark">@android:drawable/popup_center_dark</item> <item name="bottomDark">@android:drawable/popup_bottom_dark</item> <item name="fullBright">@android:drawable/popup_full_bright</item> <item name="topBright">@android:drawable/popup_top_bright</item> <item name="centerBright">@android:drawable/popup_center_bright</item> <item name="bottomBright">@android:drawable/popup_bottom_bright</item> <item name="bottomMedium">@android:drawable/popup_bottom_medium</item> <item name="centerMedium">@android:drawable/popup_center_medium</item> </style>
0 0
- 有关style的查找
- 查找的有关操作
- 有关字符串查找的问题
- 有关List查找的问题
- 有关二分查找的STL
- 五 查找的有关操作
- opencv有关轮廓查找的算法
- 查找WPF控件的默认Style的方法
- C++:与字符串常量有关的几个重要概念string literal, string, C-style charater string
- HTML5快速上手之6:与style及section有关的基本指令
- 查找用英文写的有关金庸的评论
- 有关在代码中查找安全性缺陷的专家提示
- 有关js 函数验证和字符串查找替换的方法
- dwz中“查找返回”中文参数值的有关问题
- xcode crash 查找 EXC_BAD_ACCESS 有关问题根源的方法
- 有关内存泄漏的查找解决思路方法
- 数据结构实验——查找的有关操作
- 实验五 查找的有关操作(数据结构)
- 平衡二叉树(AVL树)
- JVM系列四:生产环境参数实例及分析【生产环境实例增加中】
- glsl内建函数【转】
- android官网被封掉了,只好用这个网站进谷歌了!嘎嘎
- MATLAB关于Mesh的相关命令
- 有关style的查找
- 别急,千万别急
- 教你高考695分
- Android 获取本地外网IP、内网IP、计算机名等信息
- 【C++学习笔记】11_多维数组
- WPF ProgressBar显示进度(三)
- 放几天缝纫机
- C编程经验
- 撒旦风格