How to Rotate a Line in Android

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.

How to Rotate an Image in Android
Get Current Time in Android Programmatically
How to Set Android Button and TextView Border Color

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.


How to Rotate a Line in Android
Rotate a Line in Android

XML 795971672236324859
Home item