Comments (9)
Hi,
Actually this fix is quite important to keep the width of each grid the same.
I will look through this issue in the following weekend, and let you know soon.
Thanks
from jzcalendarweekview.
Wonderful, thank you.
from jzcalendarweekview.
Hello.
I've looked through your problem, but I am sorry that I cannot find any solutions yet.
However, I will give you some suggestions.
- I told you wrong about this 16cf27b update in the last message. Actually this update fix two issues. Let's only discuss the code in JZAllDayHeader.swift 16cf27b.
-
The code change from 36 to 40 lines actually resolve the constraints issue which will print out some conflict constraints warning in Xcode console because I set the height to 0 but the padding is actually 3. I do believe this will not affect your view.
-
For the change 56-62 lines, I think it might be the issue where it from. I changed this is just simply remove the scrollView when the AllDay events are 0, because some users don't use AllDay but those expensive scrollViews still need to be created, which might be more efficiency? You can simply discard this change to see whether it is the reason.
-
For the
initDate
issue, I think it should not be the problem if you set thedelegate
(I saw it from your above code). It is obvious to see that I only put that delegate ininitDate
didSet
method, it should be called, could you just simply add break point inJZBaseWeekView
initDate
to see whether thedidSet
has been called, then you might find the solution. -
For the jumps, I am still confused about your case, because I am not a native English speaker, you know, it quite hard to understand, haha. But, there is a quite important bug fix for all day height issue eb789aa, you can try the 9d303bd, because the previous one I made a mistake putting one print method in release code. If this update still not fix that issue, maybe can you make a small gif and show it to me?
Hopefully these opinions can help you to solve your issues.
If you get any solutions or issues, you can ask me again.
Thanks,
Jeff
from jzcalendarweekview.
Hello again! Sorry for taking so long, I've had much to do besides programming.
Thanks very much for your notes, I have looked through them and here comes a little update. A few of the problems seems to have disappeared with the newer versions by the way. I've not a native English speaker myself so the explanations may be a bit weird, hehe.
However I have looked further into this and narrowed down the problem. The code that creates the issue lies in JZBaseWeekView.swift.
Current issue update (using the same code to setup as above):
- Calendar scrollType is set to pageScroll. (sectionScroll does not create this issue).
- Using files from 2019-01-10. The JZBaseWeekView update introduces this issue.
- I added a breakpoint as you said in the
didSet
of theinitDate
. And as I scroll backwards (see below) it becomes clear that the initDate is not set when scrolling to the left.
-
I have further dissected the the issue to this: 1. When I scroll one page backwards (scrolling the calendar back in time) the
initDateDidChange()
delegate method is not called. 2. When I scroll one more page backwards I noticed that the 3 views that make up the calendar are not updated. Because I have reached the first view of the 3. 3. If I then scroll another time backwards initDateDidChange() is called and updates the view I'm on, but the calendar doesn't scroll. 4. 1-3 repeats. -
Scrolling to the right (scrolling the calendar forward in time) does not raise any issues and works perfectly. The
initDate
sdidSet
gets called as expected here.
I'll continue to see if I can find out why the initDate isn't set properly, when scrolling left.
from jzcalendarweekview.
Hi.
I tested this on the current example project and everything works fine, but probably I misunderstand your meaning.
However, I think before you go further, maybe you can try the example project and set a break point to the didSet
, if everything works fine, then it might be your problem.
If you find the example project still exists this problem, which means I do it wrong way. Let me know.
Thanks
from jzcalendarweekview.
Of course i'll try that, you are probably right. I strongly believe I might be doing something wrong here too. Since the bug would be noticed very quickly if it was from the library itself, the reason i posted was just that the update seems to have caused for me. I shall try out the example project and as well more closely examine the changes from my cached version of the library.
from jzcalendarweekview.
Hello again!
I have narrowed down the issue. Or at least I've found what caused it for me. I went through all commits til I found the one without the issue and I after that I compared the code in JZBaseWeekView.swift and noticed that if I use the latest version of the library but then comment out the flowLayout.rowHeaderWidth property change everything works as expected. I have yet to find the culprit... I have tested to change back from my custom views one by one, but that isn't causing. Well I'm gonna investigate further. But I believe it must have something to do with my implementation.
To demonstrate the change:
-
I have commented the line that cause my issue.
open override func layoutSubviews() { super.layoutSubviews() flowLayout.sectionWidth = getSectionWidth() initialContentOffset = collectionView.contentOffset } private func getSectionWidth() -> CGFloat { var sectionWidth = contentViewWidth / CGFloat(numOfDays) let remainder = sectionWidth.truncatingRemainder(dividingBy: 1) switch remainder { case 0...0.25: sectionWidth = sectionWidth.rounded(.down) case 0.25...0.75: sectionWidth = sectionWidth.rounded(.down) + 0.5 default: sectionWidth = sectionWidth.rounded(.up) } // Maximum added width for row header should be 0.25 * numberOfRows let rowHeaderWidth = frame.width - flowLayout.contentsMargin.left - flowLayout.contentsMargin.right - sectionWidth * CGFloat(numOfDays) // This is the line that causes the issue, if it is commented out everything works fine. flowLayout.rowHeaderWidth = rowHeaderWidth return sectionWidth }
Thanks for your help and interest in the issue!
from jzcalendarweekview.
Are you changing the rowHeaderWidth in another place?
For this code, it is used to fix #30 issue. For the reason, you can check this.
I think you might change this width in somewhere else, then it causes your issues.
For now, I can only explain the reason to you, and I don't know the main reason yet.
If you find out more, let me know. Thanks
from jzcalendarweekview.
Hi mate,
I think the latest v0.7.0 should resolve your issue. If you are still interested, could you have a try and let me know? I completely redesign the pagination effect in this release.
You find the release comments here
from jzcalendarweekview.
Related Issues (20)
- JZColumnHeaderBackground and JZRowHeaderBackground is always white, and sticks out in dark mode. HOT 9
- Can we show 7 days in column header for single day event view same like apple calendar?
- Could you please show how to use the calendar in SwiftUI? HOT 1
- The calendar opens up to midnight but it should auto scroll to the current user time
- Crash on jump-to-today HOT 1
- Project not building in Xcode 12.3 using carthage HOT 1
- Not able to get current date object
- How to add today's view background HOT 1
- while swiping left and right the text is missing in the calendar HOT 4
- cell was missing HOT 6
- Fix crash on iPad Air 3rd gen. (only !?)
- iOS15 - Events weird movement after scrolling HOT 1
- How can i display only singe event cell for number of events within a timeframe ?
- Making a comparison but use another value
- Overlapping Issue
- How to remove the Top date view HOT 1
- How Can we change the theme Color
- How can we change the date formatter HOT 1
- Not Show the time
- set different country time zone current date and time
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 jzcalendarweekview.