CZPicker icon indicating copy to clipboard operation
CZPicker copied to clipboard

Animation Style & Dynamic Height

Open cesarmtz93 opened this issue 5 years ago • 4 comments

Is it posible to change the transition animation style (e.g. bounceUp, bounceDown, zoomIn, fadeIn)??

cesarmtz93 avatar Jan 18 '19 18:01 cesarmtz93

I'm having issues with the height of the picker while using it with different data

any suggestions on how to solve it?

error

this is my initiation method an it gets called on every click

    func showPicker(multiple: Bool? = false) {
        let picker = CZPickerView(headerTitle: LocalizableConstants.LocalizableFieldSelect.string, cancelButtonTitle: LocalizableConstants.LocalizableTitleCancel.string, confirmButtonTitle: LocalizableConstants.LocalizableTitleConfirm.string)
        
        picker?.delegate = self
        picker?.dataSource = self
        picker?.headerTitleColor = AppColor.DarkText.color
        picker?.headerBackgroundColor = AppColor.Cyan.color
        picker?.confirmButtonNormalColor = AppColor.DarkText.color
        picker?.confirmButtonBackgroundColor = UIColor(red: 236, green: 240, blue: 241)
        picker?.cancelButtonNormalColor = AppColor.DarkText.color
        picker?.checkmarkColor = AppColor.Cyan.color
        
        if multiple! {
            picker?.allowMultipleSelection = true
            picker?.needFooterView = true
        }
        
        picker?.show()
    }

    func numberOfRows(in pickerView: CZPickerView!) -> Int {
        switch currentInputIndex {
        case 0: return productCatalogs.sizes.count
        case 1: return productCatalogs.conditions.count
        case 2: return productCatalogs.styles.count
        case 3: return productCatalogs.materials.count
        case 4: return productCatalogs.colors.count
        case 5: return productCatalogs.sleeveLengths.count
        case 6: return productCatalogs.sleeveStyles.count
        case 7: return productCatalogs.decorations.count
        case 8: return productCatalogs.lengths.count
        default: return 0
        }
    }

cesarmtz93 avatar Mar 11 '19 21:03 cesarmtz93

@chenzeyu

cesarmtz93 avatar Mar 15 '19 00:03 cesarmtz93

@cesarmtz93 first question, we currently the animation style is fixed.

For the height issue, I don't see any problem, I guess is that maybe your currentInputIndex isn't returning the right value?

chenzeyu avatar Mar 15 '19 05:03 chenzeyu

@chenzeyu the currentInputIndex is indeed returning the right value because it's loading the correct data into the picker, but the height isn't adjusting based on the amount of data, it might be a problem with cache or something like that?

cesarmtz93 avatar Mar 15 '19 18:03 cesarmtz93