我怎样才能得到背景颜色和文字颜色(默认为子视图)的活动中的Java?
解决方案 TypedArray阵列= getTheme()。obtainStyledAttributes(新INT [] {
android.R.attr.colorBackground,
android.R.attr.textColorPrimary,
});
INT的backgroundColor = array.getColor(0,0xFF00FF);
INT文字颜色= array.getColor(1,0xFF00FF);
array.recycle();
How can I get background color and text color (default for child views) of an Activity in Java?
解决方案TypedArray array = getTheme().obtainStyledAttributes(new int[] {
android.R.attr.colorBackground,
android.R.attr.textColorPrimary,
});
int backgroundColor = array.getColor(0, 0xFF00FF);
int textColor = array.getColor(1, 0xFF00FF);
array.recycle();
上一篇:机器人如何注册的onTouchEvent为整个活动的主要内容有何看法?有何、主要内容、机器人、看法
下一篇:真的混淆集previewCallback在Android中,需要咨询previewCallback、Android