In the ApiDemos, there is a view example called Gallery1 which declares a custom style in attrs.xml, as such:
In case someone is still interested, I had the same problem and solved it by adding a 'format' attribute (it seems it doesn't take 'string' as the default):