Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank Page when flipping #30

Open
ahmedbenahmed opened this issue Feb 6, 2014 · 20 comments
Open

Blank Page when flipping #30

ahmedbenahmed opened this issue Feb 6, 2014 · 20 comments

Comments

@ahmedbenahmed
Copy link

when flipping, a blank page appears randomly.

@FakerLuo
Copy link

FakerLuo commented Apr 3, 2014

Did you solve it? :)

@teffi
Copy link

teffi commented Apr 7, 2014

Im experiencing this as well. Is there anybody here who can clear things out?

@FakerLuo
Copy link

FakerLuo commented Apr 7, 2014

when rapidly flipping, a blank page appears randomly.
I guess the blank pages occur because of the pdf view.
didn't you happen that when rapidly flipping? :)
btw, my test environment is ios7.1 of ipad3.

@teffi
Copy link

teffi commented Apr 10, 2014

I think its not related to the pdf view. I am using flipper to one of my projects and it still occurs. I think its being caused by the flipper gesture recognizer setting the alpha value of the page. I'm still trying to figure out how to fix it.

@burrows111
Copy link

Guys, did anyone resolve this? currently experiencing this myself. Not related to PDF as I am now supplying UIImageView's that have images supplied from the bundle. Nothing is null that shouldnt be (As far as I can see)
I can see the subview count at 'CleanUpFlip' is less than 2 every time I get a blank 'page'
Thanks

@ahmedbenahmed
Copy link
Author

the best way is to use an other project. Try with this https://github.com/mpospese/MPFlipViewController. it works very well

@teffi
Copy link

teffi commented May 28, 2014

@burrows111 does it happen when you're rapidly flipping or not?

@burrows111
Copy link

Yeah when flipping rapidly. @teffi

@burrows111
Copy link

I hope someone can help @teffi . @ahmedbenahmed moving to a different solution is not an option as of yet but thank you for the heads up

@burrows111
Copy link

I fixed it, to my belief. If someone will be kind enough to validate what I have done that would be good. I will attached the files :)

@ahmedbenahmed
Copy link
Author

could you attach the correct files?

@burrows111
Copy link

@ahmedbenahmed how do I attach files? sorry

@ahmedbenahmed
Copy link
Author

Attach images by dragging & dropping, selecting them, or pasting from the clipboard.

@burrows111
Copy link

Cool ill sort that shortly, im currently testing on the iPad to make sure the issue is fixed.

@burrows111
Copy link

Be easier like this:
in instance method 'cleanupFlip' you previosuly had
'
if (setNextViewOnCompletion) {
[self.currentView removeFromSuperview];
self.currentView = self.nextView;
self.nextView = Nil;
} else {
[self.nextView removeFromSuperview];
self.nextView = Nil;
}

'
No I dont know why, but after an hour of debugging I noticed if the currentView was removed from superview when there was less than 2 subview on the PageFlipper you get the blank.

so, I placed an if statement in it

so

'
if (setNextViewOnCompletion) {
if(self.subviews.count ==2)
{
[self.currentView removeFromSuperview];
}

    self.currentView = self.nextView;
    self.nextView = Nil;
} else {
    [self.nextView removeFromSuperview];
    self.nextView = Nil;
}

'
Shoot the technique down all you wish, but its working for me. No issues picked up anywhere, what are your thoughts?

@teffi
Copy link

teffi commented May 28, 2014

"Rapidly flipping" still left us clueless on where or what causes the blank. Luckily, sort of, I figured one scenario where it happens. So far, it does give you a blank page when the user touches/swiped the next view while the current view is on the process of flipping causing a mess in subviews (Well, in reality most people I think won't be doing such but for a developer a bug is a bug and we can't just sleep it off).

Disabled user interaction to prevent user to swipe/interact while the flip is still on

//Under  case UIGestureRecognizerStateRecognized:
if (fabs((translation + [recognizer velocityInView:self].x / 4) / self.bounds.size.width) > 0.5) {

                setNextViewOnCompletion = YES;
                [self setFlipProgress:1.0 setDelegate:YES animate:YES];
                self.userInteractionEnabled = NO;  // Add this
                 progress.
            }

Revert back to default.

if (setNextViewOnCompletion) {
        [self.currentView removeFromSuperview];
        self.currentView = self.nextView;
        self.nextView = nil;
    } else {
        [self.nextView removeFromSuperview];
        self.nextView = nil;
    }
    self.userInteractionEnabled = YES; //Add this

@burrows111 I don't think this is the most appropriate / permanent solution to fix the blank page issue but so far with what I know this could at least lessen the possibility of users getting a blank page. Hope it helps.

@burrows111
Copy link

@teffi hey thanks for your input, check out my fix above. seems ok, running no issues so far and no blank page. not seeing the userInteraction issue though.

@burrows111
Copy link

im sorry for the formatting guys, i couldn't see a way to indicate what i pasted was code.

@teffi
Copy link

teffi commented May 28, 2014

@burrows111 on my project the subviews are not less than 2 but 1.

Edit: Been testing your solution on my end it messes up my pages.Anyway if its working good on your end then great! :)

@burrows111
Copy link

@teffi unsure, it may prove helpful. When I'm done with the project I'm doing ill fork my solution as I merged changes for a different fork that had shadows on the page turns aswell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants