Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
315
Highlighting day(s) in month view
posted

I need to change the cell background color when a user taps a cell in the month view.  In MonthViewDayTapped, I'm currently returning false, to effectively disable the day view, since we don't need that.  If there's no property/method, is there any trick I can use to set the cell color?  Ideally, I'd be able to get to each of the UIView objects for each cell in the calendar somehow, and have full access, since not everybody is going to use a calendar to show appointments (show images, etc.), but the color would be nice to set in particular. Thanks!

Parents
  • 40030
    Offline posted

    Hi Michael, 

    Thats a great feature request, and one i think we can add easily enough. 

    It'd be really helpful if you aded it on our "ideas" page (which i believe you're familiar with)

    http://ideas.infragistics.com/forums/211525-nuclios

    We're always working to get those suggestions into our controls, for example the feature request, which you've commented on: IGCalendarView Appointment Colors is already implemented and was put into the last SR. 

    In the mean time, there is an unconventional way to get at the view you'd like to manipulate: 

    -(BOOL)calendarView:(IGCalendarView *)calView monthViewDayTapped:(NSDate *)date

    {

        _prevSelectedDayView.backgroundColor = [UIColor clearColor];

        

        UIView* multiMonthView = [_cal valueForKey:@"_monthView"];

        Class c = NSClassFromString(@"DateInfo");

        id dateInfo = objc_msgSend(c, @selector(resolveInfoForDate:usingCalendarView:), date, calView);

        UIView* monthView = objc_msgSend(multiMonthView, @selector(resolveMonthViewForDate:), dateInfo);

        UIView* monthViewDay = objc_msgSend(monthView, @selector(resolveMonthViewDayForDate:), dateInfo);

        

        monthViewDay.backgroundColor = [UIColor orangeColor];

        

        _prevSelectedDayView = monthViewDay;

        

        return NO;

        

    }

    Hope this helps, 

    -SteveZ

Reply Children