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

ScollView displaced when the frame of PagedImageScrollView is initialized with an y > 0 #5

Open
kallfaktorn opened this issue Jan 29, 2014 · 0 comments

Comments

@kallfaktorn
Copy link

When PagedImageScrollView is initialized with a positive y like 20 inside the parent view. Then the subview of PagedImageScrollView. Which is the scrollView. Will appear at y position 40 inside the parent view of PagedImageScrollView. The x component may also be affected in the same way.

The following snippet of code suggests how to fix the bug.

(id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {

    /* My added piece of code. The y is set to 0(zero) so that the scrollView along with its subviews will appear at the same position as the PagedImageScrollView inside the parent of PagedImageScrollView.
    */  
    CGRect scrollViewFrame = CGRectMake(frame.origin.x, 0, frame.size.width, frame.size.height);

    self.scrollView = [[UIScrollView alloc] initWithFrame:scrollViewFrame];
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

1 participant