-
Notifications
You must be signed in to change notification settings - Fork 812
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
2 Date Segment on 1 UIView #92
Comments
Let me know if this works for you. |
Hi @patchthecode, thank you so much. It's worked with some adjustment on the measurement. I have another questions:
Thanks. |
@mrjimoy You need to create separate XIB or add View like this. class WeekdaysView: UIStackView {
private lazy var weekdayLabels: [UILabel] = self.createWeekdayLabels()
private func createWeekdayLabels() -> [UILabel] {
let formatter = NSDateFormatter()
var weekdayLabels = [UILabel]()
for i in 0...6 {
let label = UILabel(frame: CGRectZero)
label.font = UIFont.preferredFontForTextStyle(UIFontTextStyleCaption2)
label.text = formatter.veryShortWeekdaySymbols[i]
label.textColor = UIColor.lightTextColor()
label.textAlignment = .Center
weekdayLabels.append(label)
}
return weekdayLabels
}
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override func awakeFromNib() {
super.awakeFromNib()
setup()
}
private func setup() {
self.axis = .Horizontal
self.alignment = .Center
self.distribution = .FillEqually
for label in weekdayLabels {
addArrangedSubview(label)
}
}
} |
Are you trying to make your calendar look like the image you just provided above? If yes, then you can do exactly what @mecid said. Simply create a header.xib file and design it like this: You can look at the example code attached to this project to see how to create a header view. You can also checkout this wiki question
Although I do not have this feature built in, the calendar is flexible enough that you can build it your self as can be seen here. It does not take much code to build it, but I will be implementing this as a feature in the library soon. |
i'll close this issue. If you have any other questions please as it on another thread. This thread is now becoming more than one topic. |
Great, thank you so much @patchthecode :) |
Hi, can I show 2 segment using JTAppleCalendar? I mean, on a UIViewController, I would like to have 2 months displayed vertically instead of only 1.. Please see image below.
Thank you.
The text was updated successfully, but these errors were encountered: