Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save yuanliwei/f8b5b2dc05feb3cfa6cc to your computer and use it in GitHub Desktop.
Save yuanliwei/f8b5b2dc05feb3cfa6cc to your computer and use it in GitHub Desktop.
LinearLayout 在子View之间显示分割线

LinearLayout 在子View之间显示分割线

  • layout.xml
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:divider="@drawable/line_drawable"
        android:dividerPadding="8dp"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        android:showDividers="middle">
  • line_drawable.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <size android:height="1px"/>
    <solid android:color="#FFCCCCCC"/>
</shape>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment