Time for action - drawing a broken line
All of the shapes defined in Android allow you to use the
<stroke> element to define a dotted or dashed line structure, but it's really best shown-off on the line element. If we increase the width of the line and define a dash pattern with dash segments double the size of the spacing, we get a line that looks much like a "cut" or "tear" line on a printed page. This is a great way to make harder separators on a user-interface.
- Create a new shape resource XML file in the
line.xmland open this file in an editor or IDE.
- Declare the root element of the file as a
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line">
- Declare a stroke element ...