In android, you can easily draw a line in drawer file and rotate it. In this example, I will show how to rotate a line in android using xml drawable. To draw and rotate a line, first of all create a xml drawable file in drawable directory and link it in your xml activity like the following example.
Android Example: How to Rotate a Line in Android
Drawable Resource File
XML Layout File
This layout contains a view and set background to the above xml drawable file.
Java Activity File
Following is the default java code of MainActivity.java file.
|Rotate a Line in Android|