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
Paging menu items are not centered initially #59
Comments
Hmm, seems to work just fine here. What options are you using? |
here's my options
here's how I use it
|
Weird, just tried it out with exactly those options and it still works. Which version of Parchment and iOS are you using? |
iOS 11 and i'm using the latest version. Could it be because I'm possibly using a custom tab bar controller ? where the first tab is pretty much this paging menu controller? It seems to be working when I switch to another tab (i have other tabs that are using this library, they seem to be working but not on the first tab). |
Just tried to wrap this in a |
Unfortunately no, that's the entire code pretty much that I posted (aside from the custom tab bar). All I do is initialize the the paging menu controller and in the child view controllers they have zero logic in them at all. Basically just a view with text in the middle. EDIT: I can post the code of the custom tab bar if that might help |
Sure, that might be helpful |
Thanks for the quick replies, here's my code below for the custom tab bar maybe it is the cause of all of it, however, i'm not sure why.
i left out some small bits of code, but nothing related to changing views |
When you call |
That might be it, I tried moving the call to EDIT: After I put it in viewDidAppear I noticed that the frames for the first page changes when I go to the second page and back. But then after it changes it remains like that afterwards. Only noticed this once I moved my |
I would try to constrain the view using auto layout. That way the frame will be correct when the view appears, and it will also support transitioning to other sizes. Another option is to store the currently visible view as a property and set the frame in |
I decided to constrain it to the edges instead like you said, seems to have worked but now for some reason the first page in the Parch page controller frame seems to be wrong and only seems to be correct when I leave the page and come back. I printed out the frame of the page in EDIT: off-topic but is there a way you can change which tab is currently selected? |
Is it one of the views inside You can select other items by calling if let lastItem = pagingMenuVC.items.last {
pagingMenuVC.selectPagingItem(lastItem)
} |
One of the views inside of
inside of also thanks for the code for switching to another item! Appreciate it a lot |
Hmm, that's odd. Is the view for |
Not sure, how would I go about making sure that it's correct? |
You can just print out |
I printed out the frame in |
Sorry, I'm struggling to get this reproduced and it's not really obvious to me what would cause this. Are you doing anything inside |
I was finally able to fix it. I initialized it in EDIT: Works perfect for iOS11 and iOS10 seems like it's a bug with iOS9 after I moved it over to |
Hi! Sorry for the late response. Are you still seeing the bug with iOS 9? If that's the case, are you able to create a minimal bug report that re-reproduces the issue? |
Closing this for now, but feel free to open if you're able to reproduce this! |
I initialized a FixedPagingViewController with two controllers, both with icons. I setup everything inside of viewDidLoad but then I noticed that they are not centered correctly. They only are properly centered after clicking on the other icon or swiping to the other tab. Is this possible a bug? or am I just using it incorrectly
How it looks Initially
After switching to another tab
Now you can see it is properly centered
Thanks!
The text was updated successfully, but these errors were encountered: