background overdraw
2016-06-16 16:45
507 查看
../../src/main/res/layout/progress_dialog_layout.xml:6:
Possible overdraw: Root element paints background @color/theme_color_window_background with a theme that also paints a background (inferred theme is @style/AppTheme)
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Overdraw: Painting regions more than once.
If you set a background drawable on a root view, then you should use a custom theme where the theme background is null. Otherwise, the theme background will be painted first, only to have your custom background completely cover it; this is called “overdraw”.
NOTE: This detector relies on figuring out which layouts are associated with which activities based on scanning the Java code, and it’s currently doing that using an inexact pattern matching algorithm. Therefore, it can incorrectly conclude which activity the layout is associated with and then wrongly complain that a background-theme is hidden.
If you want your custom background on multiple pages, then you should consider making a custom theme with your custom background and just using that theme instead of a root element background.
Of course it’s possible that your custom drawable is translucent and you want it to be mixed with the background. However, you will get better performance if you pre-mix the background with your drawable and use that resulting image or color as a custom theme background instead.
More info:
To suppress this error, use the issue id “Overdraw” as explained in the Suppressing Warnings and Errors section.
Possible overdraw: Root element paints background @color/theme_color_window_background with a theme that also paints a background (inferred theme is @style/AppTheme)
<LinearLayout android:id="@+id/dialog_view" android:layout_width="fill_parent" android:layout_height="72dip" android:background="@color/theme_color_window_background" android:layout_marginLeft="25dp" android:layout_marginRight="25dp">
Priority: 3 / 10
Category: Performance
Severity: Warning
Explanation: Overdraw: Painting regions more than once.
If you set a background drawable on a root view, then you should use a custom theme where the theme background is null. Otherwise, the theme background will be painted first, only to have your custom background completely cover it; this is called “overdraw”.
NOTE: This detector relies on figuring out which layouts are associated with which activities based on scanning the Java code, and it’s currently doing that using an inexact pattern matching algorithm. Therefore, it can incorrectly conclude which activity the layout is associated with and then wrongly complain that a background-theme is hidden.
If you want your custom background on multiple pages, then you should consider making a custom theme with your custom background and just using that theme instead of a root element background.
Of course it’s possible that your custom drawable is translucent and you want it to be mixed with the background. However, you will get better performance if you pre-mix the background with your drawable and use that resulting image or color as a custom theme background instead.
More info:
To suppress this error, use the issue id “Overdraw” as explained in the Suppressing Warnings and Errors section.
相关文章推荐
- GUI - Web前端开发框架
- 评价ui设计作品好坏的八个标准(界面/交互设计研究)
- Jquery ui datepicker设置日期范围,如只能隔3天【实现代码】
- 为Yahoo! UI Extensions Grid增加内置的可编辑器
- Cocos2d-x UI开发之文本类使用实例
- 谈谈对jquery ui tabs 的理解
- 在IE 浏览器中使用 jquery的fadeIn() 效果 英文字符字体加粗
- UI Events 用户界面事件
- jquery UI Datepicker时间控件的使用方法(基础版)
- Hallo.js基于jQuery UI所见即所得的Web编辑器
- 基于jQuery UI CSS Framework开发Widget的经验
- jquery ui 1.7 ui.tabs 动态添加与关闭(按钮关闭+双击关闭)
- jquery UI Datepicker时间控件的使用及问题解决
- jQuery UI设置固定日期选择特效代码分享
- Jquery ajax 同步阻塞引起的UI线程阻塞问题
- jQuery UI的Dialog无法提交问题的解决方法
- jQuery ui实现动感的圆角渐变网站导航菜单效果代码
- jquery UI Datepicker时间控件的使用方法(终结版)
- jquery UI Datepicker时间控件的使用方法(加强版)
- 关于jQuery UI 使用心得及技巧