Jessica Kimble
Jessica Kimble

Reputation: 545

Placing buttons on FSCalendar UIView

I'm trying to achieve this calendar (image attached), by using FSCalendar, enter image description here

All works fine except, any button I add inside FSCalendar UIView is un-clickable in simulator, I do have gesture recognizers in the calendar view to shift between months and weeks, so apparently the reason for my problem is that,

How can I add those buttons to the calendar without disabling the calendar pan gesture recognizers? and how can the headerview be aligned to the left of the calendar instead of center?

Upvotes: 1

Views: 1497

Answers (4)

dengApro
dengApro

Reputation: 4038

How can I add those buttons to the calendar without disabling the calendar pan gesture recognizers?

I suggest you to add the button in calendar's superView. You will get the same UI looking.

superView.addSubview(calendar)
superView.addSubview(btn)

how can the headerview be aligned to the left of the calendar instead of center?

Then you should change the source code. Because the FSCalendarHeaderView.h did not fits.

FSCalendarHeaderView has a collectionView FSCalendarCollectionView, which is the headerview you need . The FSCalendarCollectionView's layout FSCalendarHeaderLayout does not fit.

You should change its size. Then call FSCalendarHeaderView's method - (void)setScrollOffset:(CGFloat)scrollOffset; to make it aligned to the left of the calendar.

Upvotes: 1

Nathaniel Gonzales
Nathaniel Gonzales

Reputation: 62

You can create another view at the top of the fscalendar view.

Upvotes: 0

Yasser
Yasser

Reputation: 263

make sure that the buttons are in front of the calendar,

    view.bringSubviewToFront(myButton)

Upvotes: 0

Kamran Zafar
Kamran Zafar

Reputation: 1

First let me know which tool you use to make User interface, if you you use Visual Studio, then go to right side of page and select Tool box and write drop down menu and then select drop down menu and use..

Upvotes: 0

Related Questions