Orientation portrait and landscape mode
I have a 2 big logo images. In landscape mode all OK. When I cha开发者_JAVA技巧nge to portrait mode, the images lay one on the other. They too big for IB alignment Can I set different views for each orientation? or how can I fix this problem.
Update to saadnib's answer. Do not use shouldAutorotateToInterfaceOrientation
. This method is for something else.
Your methods are:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
The former is called just before rotation occurs and the second one is called just after interface orientation.
You should replace UIViewController's view here or you can replace images for different orientations here too.
Use the following code
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
for current orientation and according it change your image view frames.
精彩评论