android - Set drawable for DividerItemDecoration -


divideritemdecoration divideritemdecoration = new divideritemdecoration(getcontext(),                 linearlayoutmanager.vertical);         divideritemdecoration.setdrawable(getcontext().getresources().getdrawable(r.drawable.sk_line_divider)); 

hi all! trying set custom drawable (line) divideritemdecoration, no success. mistake?

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"     android:shape="line">     <stroke         android:width="1dp"         android:color="#000000">     </stroke> </shape> 

change shape rectangle.

ex:

<shape xmlns:android="http://schemas.android.com/apk/res/android"        android:shape="rectangle">     <size         android:width="1dp"         android:height="1dp" />     <solid android:color="@color/primary" /> </shape> 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -