-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Vertical Line #557
Comments
Can you share the appearance settings to reproduce this issue? |
@FlorianMielke thanks your your quick reply. calendarView.today = nil
calendarView.register(DatePickerCalendarCell.self, forCellReuseIdentifier: "cell")
calendarView.swipeToChooseGesture.isEnabled = true
calendarView.allowsMultipleSelection = true
calendarView.clipsToBounds = true
calendarView.scrollDirection = .vertical
calendarView.dataSource = self
calendarView.delegate = self And Cell configurations: import Foundation
import UIKit
import FSCalendar
enum SelectionType : Int {
case none
case single
case leftBorder
case middle
case rightBorder
}
class DatePickerCalendarCell: FSCalendarCell {
weak var selectionLayer: CAShapeLayer!
var selectionType: SelectionType = .none {
didSet {
setNeedsLayout()
}
}
required init!(coder aDecoder: NSCoder!) {
fatalError("init(coder:) has not been implemented")
}
override init(frame: CGRect) {
super.init(frame: frame)
let selectionLayer = CAShapeLayer()
selectionLayer.fillColor = UIColor.black.cgColor
selectionLayer.actions = ["hidden": NSNull()]
self.contentView.layer.insertSublayer(selectionLayer, below: self.titleLabel!.layer)
self.selectionLayer = selectionLayer
self.shapeLayer.isHidden = true
let view = UIView(frame: self.bounds)
view.backgroundColor = Colors.white
self.backgroundView = view
backgroundColor = Colors.white
}
override func layoutSubviews() {
super.layoutSubviews()
self.backgroundView?.frame = self.bounds.insetBy(dx: 0, dy: 0)
self.selectionLayer.frame = self.contentView.bounds
var titleFrame = titleLabel.frame
titleFrame.origin.y += 3
titleLabel.frame = titleFrame
self.selectionLayer.isHidden = false
if selectionType == .middle {
self.selectionLayer.path = UIBezierPath(rect: self.selectionLayer.bounds).cgPath
self.selectionLayer.fillColor = Colors.date_picker_middle_day_bg.cgColor
}
else if selectionType == .leftBorder {
self.selectionLayer.path = UIBezierPath(roundedRect: self.selectionLayer.bounds, byRoundingCorners: [.topLeft, .bottomLeft], cornerRadii: CGSize(width: self.selectionLayer.frame.width / 2, height: self.selectionLayer.frame.width / 2)).cgPath
self.selectionLayer.fillColor = Colors.date_picker_selected_day_bg.cgColor
}
else if selectionType == .rightBorder {
self.selectionLayer.path = UIBezierPath(roundedRect: self.selectionLayer.bounds, byRoundingCorners: [.topRight, .bottomRight], cornerRadii: CGSize(width: self.selectionLayer.frame.width / 2, height: self.selectionLayer.frame.width / 2)).cgPath
self.selectionLayer.fillColor = Colors.date_picker_selected_day_bg.cgColor
}
else if selectionType == .single {
let diameter: CGFloat = min(self.selectionLayer.frame.height, self.selectionLayer.frame.width)
self.selectionLayer.path = UIBezierPath(ovalIn: CGRect(x: self.contentView.frame.width / 2 - diameter / 2, y: self.contentView.frame.height / 2 - diameter / 2, width: diameter, height: diameter)).cgPath
self.selectionLayer.fillColor = Colors.date_picker_selected_day_bg.cgColor
} else {
self.selectionLayer.isHidden = true
}
}
} |
@onurays Have you tried the latest code in master branch? |
Yeay! It is fixed in the latest version. Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you have any insight about the vertical gap between views?
The text was updated successfully, but these errors were encountered: