mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
adding in rotation for detailViewController
This commit is contained in:
parent
1ddf238839
commit
7b68b7e0d0
2 changed files with 23 additions and 1 deletions
|
@ -227,7 +227,12 @@
|
|||
|
||||
storyDetailViewController.view.tag = 12;
|
||||
[detailViewController.view addSubview:storyDetailViewController.view];
|
||||
storyDetailViewController.view.frame = CGRectMake(0,44,704,704);
|
||||
if (UIInterfaceOrientationIsPortrait(detailViewController.interfaceOrientation)) {
|
||||
storyDetailViewController.view.frame = CGRectMake(0,44,768,960);
|
||||
} else {
|
||||
storyDetailViewController.view.frame = CGRectMake(0,44,704,704);
|
||||
}
|
||||
|
||||
} else{
|
||||
UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc] initWithTitle:feedTitle style: UIBarButtonItemStyleBordered target: nil action: nil];
|
||||
[feedDetailViewController.navigationItem setBackBarButtonItem: newBackButton];
|
||||
|
|
|
@ -42,4 +42,21 @@
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
||||
NSArray *subviews = [[self.view subviews] copy];
|
||||
for (UIView *subview in subviews) {
|
||||
if (subview.tag == 12) {
|
||||
if (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
|
||||
NSLog(@"portrait");
|
||||
subview.frame = CGRectMake(0,44,768,960);
|
||||
} else {
|
||||
NSLog(@"landscape");
|
||||
subview.frame = CGRectMake(0,44,704,704);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Reference in a new issue