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

How to change Handler image when we click on it #8

Open
krutitrivedi opened this issue Feb 27, 2020 · 2 comments
Open

How to change Handler image when we click on it #8

krutitrivedi opened this issue Feb 27, 2020 · 2 comments
Assignees
Labels

Comments

@krutitrivedi
Copy link

hello, I want to change background of handler when we click on it i tried this way but not working can you please help me out and also i want transparent background when we click on handler also please guid me on how to achieve that functionality.

func floatingView(floatingView: HHFloatingView, didTapHandler isOpening: Bool) {
       let configure = HHFloatingViewConfiguration()
       if isOpening == true {
           configure.handlerImage = #imageLiteral(resourceName: "closeFloting")
           configure.handlerColor = UIColor.white
           
       }
       else {
           
          configure.handlerImage = #imageLiteral(resourceName: "FloatingButton")
          configure.handlerColor = UIColor(red: 47/255.0, green: 89/255.0, blue: 246/255.0, alpha: 
       }
   }
@hemangshah
Copy link
Owner

hemangshah commented Feb 27, 2020 via email

@hemangshah
Copy link
Owner

@krutitrivedi for this, you can do like this

func floatingViewConfiguration(floatingView: HHFloatingView) -> HHFloatingViewConfiguration {
    ...
    configure.handlerImage = floatingView.isOpen ? #imageLiteral(resourceName: "icon-ufo") : #imageLiteral(resourceName: "icon-bird")
    configure.handlerColor = floatingView.isOpen ? UIColor.red.withAlphaComponent(0.5) : UIColor.blue.withAlphaComponent(0.5)
    ...
}

func floatingView(floatingView: HHFloatingView, didTapHandler isOpening: Bool) {
    floatingView.reload()
}

Let me know if that's helpful.

@hemangshah hemangshah self-assigned this Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants