java - Add ShaderImageView programmatically -
i'd run lines of code
shaderimageview imageview = new shapeimageview(getbasecontext(), null, r.style.hexagonstyle); newphoto.setimageresource(r.drawable.image08); layout.addview(newphoto);
and error:
caused by: java.lang.runtimeexception: no resource defined shape
hexagone defined as
<style name="hexagonstyle"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="sibordercolor">@color/hexagoninnerborder</item> <item name="siborderwidth">1dp</item> <item name="sishape">@raw/maskcopya</item> </style>
the dependencies:
dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' compile 'com.github.siyamed:android-shape-imageview:0.9.2@aar' }
for more info shapeimageview: https://github.com/siyamed/android-shape-imageview
how can add shapeimageview programmatically? maybe params of shapeimageview() wrong ...
thanks in advance!
the other way round:
view view = layoutinflater.from(this).inflate(r.layout.contactlist, null); imageview contactimage = (imageview) view.findviewbyid(r.id.contactimage);
i put shaderimageview contactlist.xml , style there
solved :)
Comments
Post a Comment