From db698f4255693ec8276ec4bb16c48ad69b64e458 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 17 Mar 2011 02:50:05 -0700 Subject: Add cydia.setScrollAlwaysBounceVertical(). --- CyteKit/WebViewController.h | 1 + CyteKit/WebViewController.mm | 15 +++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'CyteKit') diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h index e3d5838..8798803 100644 --- a/CyteKit/WebViewController.h +++ b/CyteKit/WebViewController.h @@ -146,6 +146,7 @@ - (void) setViewportWidthOnMainThread:(float)value; +- (void) setScrollAlwaysBounceVertical:(bool)value; - (void) setScrollIndicatorStyle:(UIScrollViewIndicatorStyle)style; @end diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index f4bb58e..7cb5979 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -559,6 +559,7 @@ float CYScrollViewDecelerationRateNormal; allowsNavigationAction_ = true; [self setHidesNavigationBar:NO]; + [self setScrollAlwaysBounceVertical:true]; [self setScrollIndicatorStyle:UIScrollViewIndicatorStyleDefault]; // XXX: do we still need to do this? @@ -996,6 +997,20 @@ float CYScrollViewDecelerationRateNormal; [self setHidesNavigationBar:[value boolValue]]; } +- (void) setScrollAlwaysBounceVertical:(bool)value { + if ([webview_ respondsToSelector:@selector(_scrollView)]) { + UIScrollView *scroller([webview_ _scrollView]); + [scroller setAlwaysBounceVertical:value]; + } else if ([webview_ respondsToSelector:@selector(_scroller)]) { + //UIScroller *scroller([webview_ _scroller]); + // XXX: I am sad here. + } else return; +} + +- (void) setScrollAlwaysBounceVerticalNumber:(NSNumber *)value { + [self setScrollAlwaysBounceVertical:[value boolValue]]; +} + - (void) setScrollIndicatorStyle:(UIScrollViewIndicatorStyle)style { if ([webview_ respondsToSelector:@selector(_scrollView)]) { UIScrollView *scroller([webview_ _scrollView]); -- cgit v1.2.3