Skip to content

Instantly share code, notes, and snippets.

@patrickhammond
Last active August 13, 2021 03:03
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save patrickhammond/7598623 to your computer and use it in GitHub Desktop.
Save patrickhammond/7598623 to your computer and use it in GitHub Desktop.
Adds list dividers between children in a linear layout. showDividers takes a set of flags (ex: you can specify beginning|middle|end to get dividers at the start of the layout, through the layout, and at the end of the layout. API 11+ http://developer.android.com/reference/android/widget/LinearLayout.html#setShowDividers(int)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:showDividers="middle"
android:divider="?android:listDivider"
android:dividerPadding="16dp">
</LinearLayout>
@ahmednasserpro
Copy link

thank you very much, i needed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment