Currently, there are two ways to know: 1, customize a view as a separator line, 2, use a higher version of the separator line properties
One, in the need to add a divider line, add a view, such as Imageview,textview, etc. can be, such as code, the key is to set the height is small, the width of the appropriate
< ImageView Android:layout_width = "Fill_parent" android:layout_height= "1DP" android:background= "#00FF00" />
Second, is to set the linearlayout of the separation line properties, parameter description:
The android:showdividers= "" Property has 4 values:None does not show the divider (default value);beginning the dividing line at the beginning;End Displays the divider line at the end;Middle display divider lines between each of the two components:In addition to setting the Android:showdividers property, you also set the Android:divider property, which represents the image of the divider line drawable (the height of the picture is the height of the divider, so thin
The code is as follows:
Android:showdividers= "End"
You can also define a shape by yourself without a picture.
<?XML version= "1.0" encoding= "Utf-8"?><Shapexmlns:android= "Http://schemas.android.com/apk/res/android"> <sizeAndroid:width= "1DP" /> <SolidAndroid:color= "#0000FF00" /></Shape>
When you use it, just set the XML file as a picture android:divider.
How to add a separator line for Android LinearLayout