我有自定义样式
<style name="my_style" parent="@style/parent_style">
<item name="custom_color">@color/my_color</item>
</style>
并将其应用于某些观点。
我正在使用代码:
final ContextThemeWrapper ctw= new ContextThemeWrapper(getActivity(), R.style.my_theme);
View view = new View(ctw)
是否可以从代码中动态添加此custom_color属性? 类似于ctw.addAttr ......
谢谢!
答案 0 :(得分:0)
在运行时期间无法添加项目。 /res
文件夹中的所有数据都无法修改,因为ADT在编译时会从数据中构建R类。