Auto rotation of UIImageView subviews
-
21-09-2019 - |
Question
Root view is a UIImage View, it has subviews, those have subviews. My root view will open in landscape i have set both project properties in the project's .plist and have integrated application.statusBarOreintation in applicationDidFinishLaunching and verified that it works.
But all of my subviews are appearing in portrait. How do I change this on my subviews?
Thanks // :)
Solution
Do you have a viewcontroller? What is your shouldAutorotateToInterfaceOrientation returning?
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
Without a viewcontroller, you will have to apply a transform to rotate each view you load.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow