【发布时间】:2021-02-21 03:15:41
【问题描述】:
我想在 XML 中设置适合主题的 ProgressBackgroundColorSchemeColor 和 colorSchemeColors 我的滑动刷新布局。
但是,我似乎只能找到以编程方式执行此操作的解决方案like this one below。
TypedValue typedValue = new TypedValue();
int colorValue;
if (context.getTheme().resolveAttribute(R.attr.xxx, typedValue, true))
colorValue = typedValue.data;
else
colorValue = Color.TRANSPARENT;
mSwipeRefreshLayout.setColorSchemeColors(colorValue);
这些属性在 XML 中也无法识别;那有可能吗?
【问题讨论】:
标签: android xml attr swiperefreshlayout