Making rotate view function.