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

Is it possible to replace the background of a day with a photo? #81

Open
shreyasthiagaraj opened this issue Jun 3, 2015 · 7 comments
Open

Comments

@shreyasthiagaraj
Copy link

I want to customize the dates to have optional photos added onto them. Exactly like this:
http://photo365app.com/wp-content/uploads/2013/12/IMG_5898.png

Is this possible? Or could someone point me in the direction of where to begin making changes to enable this?

@shreyasthiagaraj
Copy link
Author

Got it figured out. Also got vertical scrolling functionality working in the calendar (instead of horizontal scrolling for month view). I will clean it up and push it in once v1.1.0 is fully released. If anybody needs it before then, PM me!

@akwilliamson
Copy link

@shreyasthiagaraj has the vertical scrolling been merged? I'm interested in both of these features actually...

@avicooper1
Copy link

Also interested. Can you please post the code that converts the calendar into vertical scroll mode? Thanks.

@mozharovsky
Copy link
Member

Hello guys,

This feature will be added in the coming update. Keep watching!

Regards,
Eugene

@abhinavnair
Copy link

@shreyasthiagaraj I would like to know how to have vertical scrolling with the calendar. Can you please help me with it?

@elsesiy
Copy link
Member

elsesiy commented Mar 2, 2016

@abhinavnair You already mentioned that in #98 (comment)
We're working on it! Keep watching :)

@ghost
Copy link

ghost commented Mar 7, 2016

Replace labelSetup() function for PhotoBackground

public func labelSetup(image:UIImage) {

        let width = self.bounds.size.width
        let height = self.bounds.size.height
        let imageViewBackground = UIImageView(frame: CGRectMake(0, 0, width, height))
        imageViewBackground.image = image
        let appearance = calendarView.appearance
        imageViewBackground.contentMode = UIViewContentMode.ScaleAspectFill
        self.addSubview(imageViewBackground)
        self.sendSubviewToBack(imageViewBackground)

        dayLabel = UILabel()
        dayLabel!.text = String(date.day)
        print(date.description)
        dayLabel!.textAlignment = NSTextAlignment.Center
        dayLabel!.frame = bounds

        var font = appearance.dayLabelWeekdayFont
        var color: UIColor?

        if isOut {
            color = appearance.dayLabelWeekdayOutTextColor
        } else if isCurrentDay {
            let coordinator = calendarView.coordinator
            if coordinator.selectedDayView == nil && calendarView.shouldAutoSelectDayOnMonthChange {
                let touchController = calendarView.touchController
                touchController.receiveTouchOnDayView(self)
                calendarView.didSelectDayView(self)
            } else {
                color = appearance.dayLabelPresentWeekdayTextColor
                if appearance.dayLabelPresentWeekdayInitallyBold! {
                    font = appearance.dayLabelPresentWeekdayBoldFont
                } else {
                    font = appearance.dayLabelPresentWeekdayFont
                }
            }

        } else {
            color = appearance.dayLabelWeekdayInTextColor
        }

        if color != nil && font != nil {
            dayLabel!.textColor = color!
            dayLabel!.font = font
        }

        addSubview(dayLabel!)
    }

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

No branches or pull requests

6 participants