Search code examples
iphoneiosobjective-ccalendartapku

how to change background image of Tapku calendar


i am attaching tapku calendar image below!

I tried with below code.But the image is not setted.

TKCalendarMonthView *calendar = [[TKCalendarMonthView alloc] init];

calendar.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@"fishimage.png"]];

"Thanks in Advance"


Solution

  • NO It is not possible to change whole image of Tapku calendar because it is collection of (may be) button/view which contain dates number. But you can change image of change month Arrow by following method of UIImage+TKCategory.m class

    + (UIImage*) imageNamedTK:(NSString*)str{
    
        CGFloat s = 1.0f;
        if([[UIScreen mainScreen] respondsToSelector:@selector(scale)]){
            s = [[UIScreen mainScreen] scale];
        }
    
        //NSString *path = [NSString stringWithFormat:@"%@%@.png",str,s > 1 ? @"@2x":@""];
        return [UIImage imageWithCGImage:[[UIImage imageNamed:@"img.jpg"]CGImage] scale:s orientation:UIImageOrientationUp]; // put here specific image name for display !
    
    }