richardtop / CalendarKit

📅 Calendar for Apple platforms in Swift
https://www.youtube.com/watch?v=cJ63-_z1qg8
MIT License
2.54k stars 343 forks source link

EventView - Edit TextView Frame? #236

Closed payshake closed 4 years ago

payshake commented 5 years ago

Hey all,

I'm looking for what I hope is a simple fix. I'd like to remove the top padding of the event view, so that the TextView aligns more towards the top of the EventView, and not in the center as it does now.

Can anyone point me in the right direction?

richardtop commented 5 years ago

Hi, please show me graphic illustrations of what it is right now and what you’d like to achieve. Then I’ll be able to help

Sent with GitHawk

payshake commented 5 years ago

Hi, please show me graphic illustrations of what it is right now and what you’d like to achieve. Then I’ll be able to help

Sent with GitHawk

@richardtop Thank you for the quick reply! If you see the attached image, some of the shorter EventView's (20 mins or less) don't show the text, because of a top padding in the view.

Ultimately, I'd like to have the text hug the top part of the cell, so that it would always be visible (or even better, auto-adjust the font size to fit the view)

IMG_0053

richardtop commented 5 years ago

Have you considered changing the time interval between hours? That’s already implemented in the library and would solve your problem.

Sent with GitHawk

richardtop commented 5 years ago

Try:

  override func viewDidLoad() {
    super.viewDidLoad()
    let style = StyleGenerator.defaultStyle()
    style.timeline.verticalInset = 90
    updateStyle(style)
}

in your DayViewController

payshake commented 5 years ago

@richardtop Perfect, thank you for the advice and awesome library! (let me know if I can donate via PayPal)

richardtop commented 5 years ago

Thank you! Hope you've resolved your issue. While changing the verticalInset would help in the short term, the long-term solution is to support connecting a custom view to the library, similarly to the UITableViewCell & UICollectionViewCell - there is already a ticket for it: #175.

For donations, please, contact me via Telegram, or email: topchiy at domain protonmail dot ch.

DevonAllary commented 2 years ago

Hi Richard, is this still working in the latest version? I tried to implement the above fix but it's not changing the UI at all.

richardtop commented 2 years ago

Please open a new issue with screenshots and sample code if you experience some bug.