What's the difference between windowBackground and background for activities style?

android:background is the background color (drawable to be precise) of a view component where as android:windowBackground is the background color of the window (activity or dialog) in which your view resides.


By default view's are transparent i.e no background color so visually it looks like they are taking the color from the underlying window.

Notice how the article you linked to mentions setting the windowBackground to null and not the background for fullscreen views.This is a common technique to avoid overdraws.

But the same principle can be applied to views if you have one view completely hide the other view.

自定义Theme中将android:windowBackground置为null,能小幅提升界面的绘制效率

更多相关文章

  1. Android(安卓)平铺背景图片
  2. [Android(安卓)UI界面] android中仿iphone实现listview的反弹效
  3. android中跳转系统自带的界面
  4. Android(安卓)UI绘制 - 动画基础
  5. Android中Intent传值
  6. Android控件笔记——在界面中显示图片
  7. android EditText 添加图片表情以及在四个方向上绘制图片
  8. android 使用shape来优化界面效果
  9. Android(安卓)绘制太极图

随机推荐

  1. 第一章:初入Android大门(Gallery拖动相片
  2. android6.0 netd设置dns
  3. Android Studio3.1 坑一:AAPT2 error: che
  4. Android 中文API下载
  5. Android获取分辨率和像素密度
  6. android string.xml %问题。
  7. Android 2.1 GPS定位和拍照功能代码
  8. android 自定义View设置自定义监听 框架(
  9. android 获取和设置屏幕亮度
  10. Android fragment中如何对listview添加监