mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 17:13:46 +08:00
add flag to enable momentum scrolling on iOS
Summary: Expose a `decelerationNormalEnabled` flag on WebView, which, when enabled, will WebView's ScrollView's `decelerationRate` to `UIScrollViewDecelerationRateNormal`. This gives the WebView the same "momentum" style scrolling as other iOS views. This was discussed with ide in #5447. Please let me know if there's anything I'm missing, or anything else you'd like to see in this pull request. Closes https://github.com/facebook/react-native/pull/5527 Reviewed By: svcscm Differential Revision: D2870312 Pulled By: nicklockwood fb-gh-sync-id: 7dbfd06a349e3365a5df40c3bacf25a4fdb306cf
This commit is contained in:
committed by
facebook-github-bot-4
parent
4511993ffa
commit
0f7477f9f9
@@ -30,8 +30,6 @@ var {
|
||||
View,
|
||||
} = React;
|
||||
|
||||
var RCTScrollViewConsts = UIManager.RCTScrollView.Constants;
|
||||
|
||||
var PAGE_SIZE = 20;
|
||||
|
||||
type ImageOffset = {
|
||||
@@ -249,17 +247,12 @@ class ImageCropper extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
var decelerationRate =
|
||||
RCTScrollViewConsts && RCTScrollViewConsts.DecelerationRate ?
|
||||
RCTScrollViewConsts.DecelerationRate.Fast :
|
||||
0;
|
||||
|
||||
return (
|
||||
<ScrollView
|
||||
alwaysBounceVertical={true}
|
||||
automaticallyAdjustContentInsets={false}
|
||||
contentOffset={this._contentOffset}
|
||||
decelerationRate={decelerationRate}
|
||||
decelerationRate="fast"
|
||||
horizontal={true}
|
||||
maximumZoomScale={3.0}
|
||||
onMomentumScrollEnd={this._onScroll.bind(this)}
|
||||
|
||||
Reference in New Issue
Block a user