Default Style Resource pre API Level 21
问题 I am looking to create a custom ViewGroup to be used in a library; which contains a few ImageButton objects. I would like to be able to apply a style each ImageButton ; but I cannot figure out how to apply a style programmatically other than by applying a attribute resource to the defStyleAttr parameter; like so: mImageButton = new ImageButton( getContext(), // context null, // attrs R.attr.customImageButtonStyle); // defStyleAttr The issue with this is that the only way to change the style