CZPicker
CZPicker copied to clipboard
Animation Style & Dynamic Height
Is it posible to change the transition animation style (e.g. bounceUp, bounceDown, zoomIn, fadeIn)??
I'm having issues with the height of the picker while using it with different data
any suggestions on how to solve it?
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
}
}
@chenzeyu
@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 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?