Change the selected image of the marked date in the Tapku calendar

Hi, I went through the Internet and many blogs. But there seems to be no information on how to change the image of the marked tapku calendar management date. I did some code research, but could not complete the goal.

Write now, I was able to reverse the image of the date tile. But when I do this, the text for the date goes away any ideas?

I changed the image in the TKmonthView.m file on the method

 - (void) drawTileInRect:(CGRect)r day:(int)day mark:(BOOL)mark font:(UIFont*)f1 font2:(UIFont*)f2 method 

i need help here is my code

  if(mark){ r.origin.y-=5; [[UIImage imageWithContentsOfFile:TKBUNDLE(@"TapkuLibrary.bundle/Images/calendar/Month Calendar Date Tile Gray.png")] drawInRect:r]; r.size.height = 10; r.origin.y += 18; [@"โ€ข" drawInRect: r withFont: f2 lineBreakMode: UILineBreakModeWordWrap alignment: UITextAlignmentCenter]; } 

Guys don't seem to want to talk about this. But I think I have come to a decision. The working code for my application looks like this. I just need some testing, and also to select a marked date I need some solution. I will review it. My solution is as follows

  - (void) drawTileInRect:(CGRect)r day:(int)day mark:(BOOL)mark font:(UIFont*)f1 font2:(UIFont*)f2{ if (mark) { r.origin.y-=6.5; [[UIImage imageWithContentsOfFile:TKBUNDLE(@"TapkuLibrary.bundle/Images/calendar/Month Calendar Date Tile Gray.png")] drawInRect:r]; r.origin.y+=6.5; } NSString *str = [NSString stringWithFormat:@"%d",day]; r.size.height -= 2; [str drawInRect: r withFont: f1 lineBreakMode: UILineBreakModeWordWrap alignment: UITextAlignmentCenter]; if(mark){ r.origin.y-=6; // self.selectedImageView=[UIImage imageWithContentsOfFile:TKBUNDLE(@"TapkuLibrary.bundle/Images/calendar/Month Calendar Date Tile Gray.png")]; r.origin.y +=6; r.size.height = 10; r.origin.y += 18; [@"โ€ข" drawInRect: r withFont: f2 lineBreakMode: UILineBreakModeWordWrap alignment: UITextAlignmentCenter]; } } 
+4
source share
1 answer

Images can be found at TapkuLibrary.bundle/Images/calendar/Month Calendar Today or you can specify a path to one of your own images.

 self.selectedImageView.image = [UIImage imageWithContentsOfFile:TKBUNDLE(@"TapkuLibrary.bundle/Images/calendar/Month Calendar Today Selected Tile.png")]; 

// you can use your own image

  UIImage *tile = [UIImage imageWithContentsOfFile:TKBUNDLE(@"yourImage.png")]; 
0
source

Source: https://habr.com/ru/post/1382695/


All Articles