如何更改Tapku日历的背景图像

时间:2013-01-11 12:43:17

标签: iphone ios objective-c calendar tapku

i am attaching tapku calendar image below

我尝试使用下面的代码。但是没有设置图像。

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

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

“先谢谢”

2 个答案:

答案 0 :(得分:4)

否由于是包含日期编号的(可能是)按钮/视图的集合,因此无法更改Tapku日历的整体图像。但您可以按照UIImage+TKCategory.m

的方法更改更改月箭头的图像
+ (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 !

}

答案 1 :(得分:3)

无需更改任何编码只需替换图像

goto TapkuLibrary.bundle - >图像 - >日历和 使用“Month Calendar Date Tile.png”替换您的图像

更改TKCalendarMonthView.m中的代码

tileImage = [UIImage imageNamed:@"fishimage.png"];

tileImage = [UIImage imageWithContentsOfFile:TKBUNDLE(@"calendar/Month Calendar Date Tile.png")];