Skip to content

自定义picker滚动会超出范围,会造成选中行空白 #194

@BearLatte

Description

@BearLatte

private lazy var datePicker = { () -> PGDatePicker in
let picker = PGDatePicker(frame: CGRect(x: 0, y: 0, width: Constant.screenWidth, height: 150))
picker.rowHeight = 44
picker.minimumDate = Calendar.current.date(byAdding: .year, value: -100, to: Date())
picker.maximumDate = Date()
picker.setDate(Date())
picker.datePickerMode = .date
picker.delegate = self
picker.textColorOfSelectedRow = UIColor.tm.hexColor(0x333333)
picker.textColorOfOtherRow = UIColor.tm.hexColor(0x666666)
picker.textFontOfOtherRow = UIFont.systemFont(ofSize: 15)
picker.textFontOfSelectedRow = UIFont.systemFont(ofSize: 15)
picker.isHiddenWheels = false
picker.lineBackgroundColor = UIColor.tm.hexColor(0xeaeaea)
picker.showUnit = .all
return picker
}()

这样设置添加到视图中,填充数据后,可滚动位置会变大,滚动到最底部就会造成选中行全部空白,这是我设置的问题还是内部计算的bug,我看demo中并没有这个问题

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions