52inc / Pulley

A library to imitate the iOS 10 Maps UI.
https://cocoapods.org/pods/Pulley
MIT License
2.02k stars 265 forks source link

How to change background color of drawerContentVC #382

Open AshutosQuickride opened 4 years ago

AshutosQuickride commented 4 years ago

pulleyDrawerVC.backgroundDimmingColor = .clear pulleyDrawerVC.backgroundDimmingOpacity = 1.0 after setting this also background color is still setting some blur color

amyleecodes commented 4 years ago

The background dimming settings don’t control the drawer. That controls the color of the background that “dims” the primary content VC when the drawer is open all the way.

If you want to remove the blur, set this to nil on PulleyViewController: drawerBackgroundVisualEffectView

You need to provide a background color in your drawer VC. Pulley won’t provide a background color for you.

AshutosQuickride commented 4 years ago

I have set the above things but still i am getting the blur color for drawer can we remove that background color of it?

amyleecodes commented 4 years ago

Please read my previous comment. It says what you were setting is wrong, and the correct way to remove the blur.

AshutosQuickride commented 4 years ago

Yes according to previous comment i have removed and updated my code

let mainContentVC = UIStoryboard(name: StoryBoardIdentifiers.mapview_storyboard, bundle: nil).instantiateViewController(withIdentifier: "CreateRideHomeViewController") as! CreateRideHomeViewController let drawerContentVC = UIStoryboard(name: StoryBoardIdentifiers.mapview_storyboard, bundle: nil).instantiateViewController(withIdentifier: "CreateRideBottomViewController") as! CreateRideBottomViewController

        let pulleyDrawerVC = PulleyViewController(contentViewController: mainContentVC, drawerViewController: drawerContentVC)

pulleyDrawerVC.drawerBackgroundVisualEffectView = nil

And still i am getting the same blur background color.

amyleecodes commented 4 years ago

You need to set it after the view controller’s viewDidLoad has been called, since that’s where the built-in visual effect view is created and added.

You can force the view to load if you call loadViewIfNeeded(). Do that before you set it to nil.

AshutosQuickride commented 4 years ago

still it does not work for me Did you ever tried this . If you have can me share the demo with me?

amyleecodes commented 4 years ago

Yes, I’ve tried this. It’s an officially supported API and has a comment in the file telling you how to do this.

I don’t have a demo I can share.

Farazahmed90 commented 2 years ago

Did anyone get the answer on how to disable this blur effect?