c# - 安卓/C# : Detect that NestedScrollView reached the bottom

标签 c# android nestedscrollview

<分区>

如标题所示,我正在寻找一个检测到 nestedscrollview 到达布局底部的事件。

最佳答案

根据@EugenUngurean 和@rishit_s 评论的链接找到了我的解决方案。非常感谢你们。

基本上我继承了IOnScrollChangeListener。

public class EventFragment : MvxCachingFragmentCompatActivity<EventInfoViewModel>, IOnScrollChangeListener

然后创建一个NestedScrollView OnScrollListener 并用监听器的接口(interface)完成。 BottomSheet.SetOnScrollChangeListener(this);

 public void OnScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY)
    {

       if (scrollY == (v.GetChildAt(0).MeasuredHeight - v.MeasuredHeight))
        {
            SwitchToEventInfo(true);

        }
        else if (scrollY == 0)
        {
            SwitchToEventInfo(false);
        }
    }

关于c# - 安卓/C# : Detect that NestedScrollView reached the bottom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42363262/

相关文章:

android.widget.ProgressBar 无法转换为 android.widget.LinearLayout

android - 未在 fragment 中调用 baseadapter 的 getview() 方法

android - 在整个 Activity 生命周期内保持数字键盘打开

java - 带有内部嵌套 ScrollView 的 Recyclerview?

c# - 绑定(bind)方法?

c# - PDF云注释背后的算法是什么?

android - 在 NestedScrollView Android 2.3 或更低版本中发布滚动 WebView

c# - 为什么运算符比方法调用慢得多? (结构仅在较旧的 JIT 上较慢)

c# - 单独程序集中的 WCF 服务