Comments (13)
首先你找到SyllabusActivity中 97 98 行 在确保你的View绘制出来之后调用这两句话 最后一个参数 时间 改为0 然后你在你的recyclerView的实例对象使用setNestedScrollingEnabled(false)这个方法 禁止掉嵌套滑动就可以了
from supercalendar.
感谢!
from supercalendar.
额,ST同学解决了吗?
from supercalendar.
@JYPJSY 根据楼上作者的回复,已经解决了
from supercalendar.
@StephenCMZ 老哥
Utils.scrollTo(content, recyclerView, monthPager.getCellHeight(), 200);
calendarAdapter.switchToWeek(0);
这两句代码你些在哪里了。我放在initMonthPager();这个方法后面了。但是变为周的时候显示空白。滑动一下就好了。
from supercalendar.
@StephenCMZ 请问,初始化就是周历的话。你的周历滑动操作,周历数据不会异常吗??我的周历数据异常了。求教,除了作者回复的修改,你还修改了哪里,谢谢。
from supercalendar.
@hqAnd 根据作者的回答是“在确保你的View绘制出来之后调用”,放在initMonthPager();后面出现异常,估计是 View 还没绘制完成吧。我是如下调用的:
@Override
public void onStart() {
super.onStart();
if (calendarAdapter.getCalendarType() != CalendarAttr.CalendayType.WEEK){
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
scrollSwitchAction();
}
},500);
}
}
from supercalendar.
@JYPJSY 确实有出现过周历数据异常,我的做法是延迟切换到周模式:
@Override
public void onStart() {
super.onStart();
if (calendarAdapter.getCalendarType() != CalendarAttr.CalendayType.WEEK){
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
scrollSwitchAction();
}
},500);
}
}
from supercalendar.
Utils.scrollTo(content, recyclerView, monthPager.getCellHeight(), 0);//时间改为0
calendarAdapter.switchToWeek(monthPager.getRowIndex());//滑动到当前日所在行
这两句方法可以在
@OverRide
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus && !initiated) {
refreshMonthPager();
initiated = true;
}
}
这句生命周期的回调中添加
添加完后可以提pull request ,将这个操作作为日历的一个特性封装起来
from supercalendar.
@MagicMashRoom 我布局外层没有像你demo那样嵌套,怎么设置,在初始日历的时候只显示week模式?
from supercalendar.
@MagicMashRoom 只想要你的周日历效果,不需要下面的RecycleView,可以设置吗
from supercalendar.
问题太多了,基本的需求没办法满足;希望做成通用一点的
from supercalendar.
@MagicMashRoom 老哥,如何单纯使用月模式呢?
from supercalendar.
Related Issues (20)
- 那个效果图中的下拉按钮怎么加上去啊
- calendarViewAdapter.notifyDataSetChanged()为刷新view 手动触摸触发setPrimaryItem时 触发视图刷新 HOT 1
- calendarViewAdapter.notifyDataSetChanged()为刷新view 手动触摸触发setPrimaryItem时 触发视图刷新
- 点击灰色区间出现日期换乱
- 如何设置活动日期,日期下面那个黄色的圆点
- 怎么监听到向上滑变成一行日期的事件
- 解决点击日期错乱问题 !!!!!!!!!!! HOT 2
- 怎么更改只显示当前月的日期,就像钉钉考勤日历那样,
- 怎么添加上下滑动的那个图片啊 HOT 1
- 麻烦老大把添加上下滑的图片那部分代码发出来一下,谢谢了
- 效果图挂了 能更新一下图片吗
- 如何取消今天的默认选中状态 HOT 1
- java.lang.IllegalArgumentException:pointerIndex out of range
- 配合SmartRefreshLayout
- 如何设置日期不可选中
- setMarkData标记的默认颜色能更改吗?
- 关于设置默认周显示 HOT 1
- 如何设置以日为单位进行滑动
- 滑动错乱
- 你好,请问下,我想在日历下面放一个向上和向下折叠的图标,可以提供一个思路吗?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supercalendar.