calendarview stops scrolling when nested in scrollview in android

前端 未结 2 2008
盖世英雄少女心
盖世英雄少女心 2021-01-14 00:06

I have nested calendarview in ScrollView . My problem begins when height of view increases. I can scroll calendar months vertically but when scrollview

2条回答
  •  既然无缘
    2021-01-14 00:45

    Here's one solution, you can implement a custom ScrollView which will only intercept verticale swipe.

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {...}
    

    "onInterceptTouchEvent" will return false for horizontal swipe, so horizontal swipe will be enable for the CalendarView.

    You can read more about this heree : https://stackoverflow.com/a/2655740/5158173

提交回复
热议问题