当前位置: 代码迷 >> Android >> Android目无全牛之WindowBackground
  详细解决方案

Android目无全牛之WindowBackground

热度:6   发布时间:2016-04-28 07:20:16.0
Android庖丁解牛之WindowBackground

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,能小幅提升界面的绘制效率

  相关解决方案