Rotate ImageView source from layout xml file
You can use Available Since API Level 11
android:rotation="90"
Final Code to Put,
<ImageView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:rotation="90"
android:contentDescription="@string/image_divider"
android:paddingBottom="8dp"
android:paddingTop="4dp"
android:scaleType="fitXY"
android:src="@android:drawable/divider_horizontal_textfield" />
Add "id" at ImageView (if not generate auto):
android:id="@+id/imageView"
and use the "id" (kotlin example):
val imageView = findViewById<ImageView>(R.id.imageView)
imageView.setRotation(90f) // rotate 90 degree