I have this ImageView in my layout:
Add "id" at ImageView (if not generate auto):
android:id="@+id/imageView"
and use the "id" (kotlin example):
val imageView = findViewById(R.id.imageView) imageView.setRotation(90f) // rotate 90 degree