LiquidFloatingActionButton icon indicating copy to clipboard operation
LiquidFloatingActionButton copied to clipboard

Customize Plus button

Open gabhisekdev opened this issue 9 years ago • 6 comments

I am using this framework to create floating button in my project. I have a requirement to add a button image other than the plus sign in my project. Is it possible,I have tried many ways but failed. Please suggest some codes or ideas to do so? Thanks.

gabhisekdev avatar Feb 10 '16 09:02 gabhisekdev

Can't we change the plus button icon?

pedro380085 avatar Feb 18 '16 22:02 pedro380085

I don't think we can customize the plus button.

gabhisekdev avatar Feb 19 '16 10:02 gabhisekdev

you need to override the createpluslayer:

    class editLiquidButton: LiquidFloatingActionButton {
        override func createPlusLayer(frame: CGRect) -> CAShapeLayer {
            let editLayer = CAShapeLayer()
            // add shapelayer here
            return editLayer
        }
    }

galileomd avatar Feb 25 '16 22:02 galileomd

But can we add image to it. If so then how?Can you please throw some light on that?

gabhisekdev avatar Feb 26 '16 04:02 gabhisekdev

let button = LiquidFloatingActionButton(frame: frame) button.image = UIImage(named: "yourfilehere")

galileomd avatar Feb 26 '16 04:02 galileomd

Thanks,I will give it a try....

gabhisekdev avatar Feb 26 '16 05:02 gabhisekdev