summaryrefslogtreecommitdiff
path: root/CyteKit
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-17 02:50:05 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-17 02:50:05 -0700
commitdb698f4255693ec8276ec4bb16c48ad69b64e458 (patch)
treed1bf5ff9fe681847d807dd5df791846f5a5360aa /CyteKit
parent4886cc818ca3f52c7c1683b45ffcdef8b6e57217 (diff)
Add cydia.setScrollAlwaysBounceVertical().
Diffstat (limited to 'CyteKit')
-rw-r--r--CyteKit/WebViewController.h1
-rw-r--r--CyteKit/WebViewController.mm15
2 files changed, 16 insertions, 0 deletions
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]);