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

bacgrkound Color, Bar Color #11

Closed
alexookah opened this issue Oct 7, 2017 · 9 comments
Closed

bacgrkound Color, Bar Color #11

alexookah opened this issue Oct 7, 2017 · 9 comments

Comments

@alexookah
Copy link
Contributor

These two arguments would be nice as a configuration when creating the PagerController()

let pagerController = PagerController()
pageController.bgColor = UIColor.grey
pageController.scrollIndicatorColor = UIColor.red

@tungvoduc
Copy link
Owner

@alexookah PagerController is a UIViewController so you can change its background color by setting its view's background color. Same with the bar color, pageSegmentedControl.backgroundColor to change its color. Except with scroll indicator color, there is no public API for that, but what I can do is to expose the pageScrollView.

@alexookah
Copy link
Contributor Author

thank you very much for your answer.
exposing the pagescrollview would be nice.

one more question:
is there a option to disable bounces? so that you can use the back to previous swipe?

@tungvoduc
Copy link
Owner

@alexookah Do you mean UIScrollView bounces? After pageScrollView is exposed then you can disable it by setting pageScrollView.bounces = false.
I just did not get why it has anything to do with go back to previous swipe so I will just answer those as separate questions. If you want to keep track of the previous tab index, you can set delegate and implement the following delegate method of DTPagerControllerDelegate object:

func pagerController(_ pagerController: DTPagerController, willChangeSelectedPageIndex index: Int, fromPageIndex oldIndex: Int) {
    previousTabIndex = oldIndex // Store previous tab index
}

@alexookah
Copy link
Contributor Author

alexookah commented Oct 8, 2017

no i meant if you are in homePage viewController when you push to a viewcontroller that is PageController.
there is no way to get back to the previous view controller (homePage). using the swipe gesture from left corner and not the back button from navigation controller

@tungvoduc
Copy link
Owner

@alexookah Okay now I get it now. You should be able to pop back using edge swipe gesture. However, if you still want to disable scrolling, you can use this after pageScrollView being exposed:

pageScrollView.isScrollEnabled = false

@alexookah
Copy link
Contributor Author

but that would disable the functionality scrolling right? and you could switch viewCotnrollers only by using the button.

Couldn't just add a functionality to identify geture on the left edge to go back?

@tungvoduc
Copy link
Owner

@alexookah Yes exactly! But the scrolling and edge pop gesture are working fine together for me. I will check again soon.

@tungvoduc
Copy link
Owner

@alexookah Okay I already checked, everything is working fine. If you want to check, you can add into sample project a button and make it push to another PagerController, you should still be able to go back with pop gesture.

@tungvoduc
Copy link
Owner

@alexookah Version 1.1.2 is out. pageScrollView is now accessible. Enjoy!

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