Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
BearLatte opened this issue Nov 2, 2021 · 0 comments
Open

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

BearLatte opened this issue Nov 2, 2021 · 0 comments

Comments

@BearLatte
Copy link

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中并没有这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant