<ListView
android:id="@+id/activity_home_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@android:color/transparent"
android:dividerHeight="8dp"/>
You can add divider and dividerHeight properties between list viewsYo
<android.support.v7.widget.RecyclerView
android:id="@+id/activity_home_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"/>
But you don't see that in RecyclerView. Do I just add a custom divider directly to the item view? Is there a better way?
android material-design recyclerview divider
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_recycler_view, container, false);
mRecyclerView = (RecyclerView) rootView.findViewById(R.id.my_recycler_view);
mRecyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
mRecyclerView.setHasFixedSize(true);
mLayoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
return rootView;
}
https://gist.github.com/alexfu/0f464fc3742f134ccd1e Please refer to this source and add DividerItemDecoration to addItemDecoration in RecyclerView's onCreateView.
574 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
585 PHP ssh2_scp_send fails to send files as intended
626 Uncaught (inpromise) Error on Electron: An object could not be cloned
618 GDB gets version error when attempting to debug with the Presense SDK (IDE)
577 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.