Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ancazapuc9/de4f926a93965b7cea8dc4f400243e0d to your computer and use it in GitHub Desktop.
Save ancazapuc9/de4f926a93965b7cea8dc4f400243e0d 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment