17
Próbuję ustawić niestandardową linię do rysowania dla obiektu DividerItemDecoration, ale bez powodzenia. Gdzie jest błąd?Zestaw do losowania dla obiektu DividerItemDecoration
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(getContext(),
LinearLayoutManager.VERTICAL);
dividerItemDecoration.setDrawable(getContext().getResources().getDrawable(R.drawable.sk_line_divider));
XML kształt:
<?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>
Przy okazji, nie trzeba 'DividerItemDecoration # setDrawable' można ustawić' android: atrybut listDivider' w temacie zamiast. – arekolek