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

scrollView inside JTCalendarMenuView not being initialized properly. #177

Closed
franciszabala opened this issue Jul 25, 2015 · 9 comments
Closed

Comments

@franciszabala
Copy link

I am having problem with JYCalendarMenuView.

It crashes when the view is loading. I am not sure what code to share except that the viewcontroller is being pushed from a uinavigationcontroller using storyboards.

Here's what I got when i Po'd.

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    //[_manager.scrollManager updateHorizontalContentOffset:(_scrollView.contentOffset.x / _scrollView.contentSize.width)];
    if (_scrollView.contentSize.width == 0) {

    } else {
    [_manager.scrollManager updateHorizontalContentOffset:(_scrollView.contentOffset.x / _scrollView.contentSize.width)];
    }

}
@jonathantribouharet
Copy link
Owner

Thanks, I update the pod, try with this new version.

@franciszabala
Copy link
Author

The crash doesn't occur anymore but the CalendarMenu isn't being displayed. I am trying to trace why the scrollView isn't set with the correct contentSize.

@jonathantribouharet
Copy link
Owner

Do you create the contraints for the menu view? Check the frame of the menu view in viewDidAppear.

When the frame of menu view change, it supposed to update the contentSize.
Try to call [_calendarMenuView updatePageMode:0]; in viewDidAppear, it will force t update the contentSize for see if it's changed something.

@franciszabala
Copy link
Author

It didn't work. :( I just copied the basic example and placed it in my project and it should work with out any problems. It's weird. I'll try trace it again.

@jonathantribouharet
Copy link
Owner

What size have you for menu view in viewDidLoad and viewDidAppear?

@franciszabala
Copy link
Author

I didn't set any size in code. But on the nib, it's w300 and h50. All codes and nibs are lifted from the BasicExample

@jonathantribouharet
Copy link
Owner

Yes but interface builder may not work like you expect, this is why I asked you to check the frame of menu view for be sure the frame are exactly what you expect.

So write NSLog(@"viewDidLoad: %@", NSStringFromCGRect(_calendarMenuView.frame)); in viewDidLoad and viewDidAppear and give me this values.

@franciszabala
Copy link
Author

Oh ok. Here's my results:

viewDidLoad: {{0, 50}, {600, 50}}
viewDidAppear: {{0, 20}, {375, 50}}

@franciszabala
Copy link
Author

Hi! It is actually working. It's hidden from the navigation bar. Ugh. Sorry for the mess.

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

2 participants