kciter / Floaty

:heart: Floating Action Button for iOS
MIT License
1.58k stars 310 forks source link

Item icons are not in center #321

Open imnayandave opened 1 year ago

imnayandave commented 1 year ago

image

Code for above Image

/// *Adding Floaty Item Buttons*
private func add_Floaty_Butttons() {
    for i in 0..<3 {
        let button = FloatyItem()
        switch i {
        case 0:
            button.icon = UIImage(named: "ic-Files")
            button.handler = { [weak self] _ in
                self?.init_DocumentPicker()
            }
        case 1:
            button.icon = UIImage(named: "ic-Galley")
            button.handler = { [weak self] _ in
                self?.open_Photo_Gallery()
            }
        case 2:
            button.icon = UIImage(named: "ic-Camera")
            button.handler = { [weak self] _ in
                self?.open_Camera()
            }
        default: debugPrint("Invalid Index")
        }
        button.iconTintColor = .white
        button.buttonColor = .ourAppThemeColor
        button.size = 60
        btnFloaty.addItem(item: button)
    }
    view.addSubview(btnFloaty)

    btnFloaty.openAnimationType = .semiCircular     
    btnFloaty.circleAnimationDegreeOffset = 30     
    btnFloaty.circleAnimationRadius = 90    
}