【问题标题】:Why does Ionic default has-bouncing on ion-content to false?为什么 Ionic 默认在 ion-content 上反弹为 false?
【发布时间】:2016-09-23 19:10:42
【问题描述】:

我无法找到有关 Ionic 为何希望将 ion-content 上的 has-bounceing 默认设置为 false 的文档。

我的一般理解是 ionic 已经从本机(ios 和 android)控制了滚动处理。因此,我试图了解 has-bounce 配置选项的局限性。即,如果我将 has-bounceing 设置为 true,将会/可能会破坏什么?

While we recommend using the custom Scroll features in Ionic in most cases, sometimes (for performance reasons) only the browser’s native overflow scrolling will suffice, and so we’ve made it easy to toggle between the Ionic scroll implementation and overflow scrolling. http://ionicframework.com/docs/api/directive/ionContent/

旁注:android 似乎有一个本地方法来处理这个事件? (https://developer.android.com/reference/android/widget/ScrollView.html#setOverScrollMode%28int%29)。

提前感谢您的任何见解!

【问题讨论】:

    标签: android cordova ionic-framework


    【解决方案1】:

    has-bouncing 属性仅在您滚动到视图的最顶部或底部时添加一种效果(见图)。它在 Android 中默认设置为 false,在 iOS 中默认设置为 true,因为它是 iOS 原生应用程序的默认组件,而不是 Android。

    【讨论】:

    • 感谢 e666 的回答。我试图更多地了解为什么它是 iOS 本机默认值而不是 android 本机默认值。即,Android 是否有其他本地方法来处理“反弹”? “反弹”会破坏原生 Android 滚动吗? 'bounce' 是否会破坏 Android 上的 Ionic 滚动(或其他一些组件)?或者,此默认设置是否与 Android 的样式选择一样简单,所以 Ionic 复制了该样式选择?
    • 风格选择很简单。如果需要,您可以在 Android 上启用它。
    猜你喜欢
    • 1970-01-01
    • 2019-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-08
    • 2018-08-09
    • 1970-01-01
    相关资源
    最近更新 更多