AlertDialog 源码布局调整
来源:互联网 发布:mac硬件温度检测 编辑:程序博客网 时间:2024/05/24 07:18
AlertDialog 统一修改 布局样式。首先要找到底层布局文件,\frameworks\base\core\res\res\layout 下 alert_dialog_material.xml
<LinearLayout ....... <TextView android:id="@+id/message" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingEnd="?attr/dialogPreferredPadding" android:paddingStart="?attr/dialogPreferredPadding" android:fontFamily="@string/font_family_subhead_material" android:textColor="?attr/textColorPrimary" android:textSize="30dp" /> ....... <include layout="@layout/alert_dialog_button_bar_material" /></LinearLayout>
修改alert_dialog_button_bar_material
<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2014 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.--><com.android.internal.widget.ButtonBarLayout ...... <Button android:id="@+id/button3" style="?attr/buttonBarNeutralButtonStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Space android:id="@+id/spacer" android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="0" android:visibility="gone" /> <Button android:id="@+id/button2" android:layout_weight="1" android:layout_width="0dp" android:textSize="30dp" android:layout_height="wrap_content" /> <Button android:id="@+id/button1" android:layout_weight="1" android:layout_width="0dp" android:textSize="30dp" android:layout_height="wrap_content" /></com.android.internal.widget.ButtonBarLayout>
调整后布局如图
0 0
- AlertDialog 源码布局调整
- android AlertDialog自定义布局
- 【Android】自定义AlertDialog布局
- 自定义AlertDialog布局
- 自定义AlertDialog对话框布局
- AlertDialog自定义布局
- AlertDialog加入布局文件
- 自定义AlertDialog布局
- Android AlertDialog自定义布局
- AlertDialog自定义布局
- AlertDialog自定义布局
- android alertdialog布局 dialog布局
- android alertdialog布局 dialog布局
- AlertDialog源码解析
- AlertDialog源码分析
- AlertDialog源码解析之一
- AlertDialog源码分析
- AlertDialog 源码解析一
- 最小二乘学习算法基础
- 网络爬虫学习(三)
- 【运维管理】运维人员必须熟悉的运维工具汇总
- 算法基础
- LeetCode 268. Missing Number
- AlertDialog 源码布局调整
- 关于“平衡”与“常识”的一点想法
- 机器视觉数据集链接
- 使用phpredis批量向sort set中加入元素
- Oracle表名称和字段名称区分大小写
- OPENGL颜色混合
- STM32学习笔记
- 关于python及nump,scipy,matlplotlib,scikit-learn的安装的体会总结
- 线程的五种状态