【发布时间】:2012-09-04 17:46:54
【问题描述】:
我尝试过这样的事情,但我卡住了:
TypedValue typedValue = new TypedValue();
if (this.parentActivity.getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true))
{
// how to get color?
}
【问题讨论】:
-
在 xml android:background="?android:attr/colorBackground"
-
我测试并确定
?android:attr/colorBackground对应styles.xml项<item name="android:colorBackground">@color/yourColorHere</item>。 -
@ademar111190 这应该是答案!!!
标签: android