Comments (6)
HI,
thank you very much for your tip and help.
But I could not reproduce your bug.
Do you have an example code?
Cheers
Christian
Christian Menschel
CEO & App Developer
tapwork. mobile design & development.
Vogelsanger Straße 286 · 50825 Köln
fon: 0221.42 302 63 · mobil: 0171.68 05 882
mail: [email protected]
On 25.07.2012, at 17:43, evfemist wrote:
Steps to reproduce:
1 -(NSInteger)punchscrollView:(PunchScrollView *)scrollView numberOfPagesInSection:(NSInteger)section must return >2.
2 scroll to the not first page.
3 reload with -(NSInteger)punchscrollView:(PunchScrollView *)scrollView numberOfPagesInSection:(NSInteger)section returned 0.
4 reload with -(NSInteger)punchscrollView:(PunchScrollView *)scrollView numberOfPagesInSection:(NSInteger)section returned more than 2.
5. nothing will be displayed.My propose to fix (lines with changes marked with '!!!'):
(void)pageIndexChanged
{
NSInteger newPageIndex = NSNotFound;[self loadPages];
if (direction_ == PunchScrollViewDirectionHorizontal)
{
CGFloat pageWidth = self.pageSizeWithPadding.width;
!!! newPageIndex = floor(self.contentOffset.x) / ((floor(pageWidth)==0)?(1):(floor(pageWidth)));
}
else if (direction_ == PunchScrollViewDirectionVertical)
{
CGFloat pageHeight = self.pageSizeWithPadding.height;
!!! newPageIndex = floor(self.contentOffset.y) / ((floor(pageHeight)==0)?(1):(floor(pageHeight)));
}
...
}
Reply to this email directly or view it on GitHub:
#5
from punchscrollview.
Did you receive my email? It was sent 25 July 2012 22:35
from punchscrollview.
Hi
Yes, but I did not have any time yet.
Maybe next week. Because I am on vacation right now
Cheers
sent from mobile
Christian Menschel
CEO & App Developer
tapwork. mobile design & development.
Vogelsanger Straße 286 · 50825 Köln
fon: 0221.42 302 63 · mobil: 0171.68 05 882
mail: [email protected]
Am 30.07.2012 um 12:01 schrieb evfemist [email protected]:
Did you receive my email? It was sent 25 July 2012 22:35
Reply to this email directly or view it on GitHub:
#5 (comment)
from punchscrollview.
Ok, np. Have a nice vacation!
On 30 July 2012 15:27, Christian Menschel <
[email protected]
wrote:
Hi
Yes, but I did not have any time yet.
Maybe next week. Because I am on vacation right now
Cheerssent from mobile
Christian Menschel
CEO & App Developertapwork. mobile design & development.
Vogelsanger Straße 286 · 50825 Köln
fon: 0221.42 302 63 · mobil: 0171.68 05 882
mail: [email protected]Am 30.07.2012 um 12:01 schrieb evfemist [email protected]:
Did you receive my email? It was sent 25 July 2012 22:35
Reply to this email directly or view it on GitHub:
#5 (comment)
Reply to this email directly or view it on GitHub:
#5 (comment)
With best wishes, Roman Stetsenko.
from punchscrollview.
Hi
I added your code suggestions
thanks a lot again
I think you had problems with pages that a width or height = 0 ?
from punchscrollview.
Hi! I dont think so, cause all my pages use only one size - 320x320 px.
And issue happens when:
- numberOfSectionsInPunchScrollView returns some number
- then I call reloadData
- numberOfSectionsInPunchScrollView returns 0
- again call reloadData
- numberOfSectionsInPunchScrollView returns some number
- and again call reloadData
I haven't time for deep testing. I am not sure, but my thoughts is that this related to
pageSizeWithPadding_ = CGSizeZero;
in - (void)reloadData.
anyway thanks for your work!!!
have a good time!
from punchscrollview.
Related Issues (5)
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 punchscrollview.