put in a fix for the feedgradientbar and added rotating to more views

This commit is contained in:
Roy Yang 2012-06-08 10:37:51 -07:00
parent 85fd5b3526
commit 6b114fc9a8
5 changed files with 19 additions and 23 deletions

View file

@ -54,6 +54,10 @@
[super viewDidLoad];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (void)viewWillAppear:(BOOL)animated {
self.pageFinished = NO;
[MBProgressHUD hideHUDForView:self.view animated:YES];

View file

@ -634,7 +634,7 @@
[gradientView addSubview:titleImageView];
} else {
gradientView = [NewsBlurAppDelegate
makeGradientView:CGRectMake(0, -1, window.frame.size.width, 10)
makeGradientView:CGRectMake(0, -1, 1024, 10) // hard coding the 1024 as a hack for window.frame.size.width
startColor:[feed objectForKey:@"favicon_color"]
endColor:[feed objectForKey:@"favicon_fade"]];
}

View file

@ -117,17 +117,9 @@
[super viewWillDisappear:animated];
}
/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/
- (BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)toInterfaceOrientation {
return YES;
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (void)didReceiveMemoryWarning {

View file

@ -48,6 +48,10 @@
}
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (void)viewDidLoad {
CGRect navBarFrame = self.view.bounds;

View file

@ -64,15 +64,11 @@
initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]
autorelease];
UIScrollView* currentScrollView;
for (UIView* subView in self.webView.subviews) {
if ([subView isKindOfClass:[UIScrollView class]]) {
currentScrollView = (UIScrollView*)subView;
currentScrollView.delegate = self;
}
[super viewDidLoad];
}
[super viewDidLoad];
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (void)viewWillAppear:(BOOL)animated {
@ -205,7 +201,7 @@
" display: none;"
"}"
"</style>"
"<meta name=\"viewport\" content=\"width=768\"/>"];
"<meta name=\"viewport\" content=\"width=device-width\"/>"];
} else {
imgCssString = [NSString stringWithFormat:@"<style>"
"body {"
@ -285,7 +281,7 @@
" display: none;"
"}"
"</style>"
"<meta name=\"viewport\" content=\"width=320\"/>"];
"<meta name=\"viewport\" content=\"width=device-width\"/>"];
}
NSString *story_author = @"";
if ([appDelegate.activeStory objectForKey:@"story_authors"]) {
@ -335,7 +331,7 @@
[appDelegate.activeStory
objectForKey:@"story_feed_id"]]];
self.feedTitleGradient = [appDelegate makeFeedTitleGradient:feed
withRect:CGRectMake(0, -1, self.webView.frame.size.width, 21)];
withRect:CGRectMake(0, -1, 1024, 21)]; // 1024 hack for self.webView.frame.size.width
self.feedTitleGradient.tag = 12; // Not attached yet. Remove old gradients, first.
for (UIView *subview in self.webView.subviews) {