星空网 > 软件开发 > 操作系统

【代码笔记】日历

一, 效果图。

【代码笔记】日历images/loading.gif' data-original="http://images2015.cnblogs.com/blog/337518/201510/337518-20151016093654679-778821810.jpg" width="218" height="400" />

二,工程图。

【代码笔记】日历

三,代码。

RootViewController.h

【代码笔记】日历
#import <UIKit/UIKit.h>#import "CalendarView.h"#import "CalendarUtils.h"#import "CalendarStyle.h"@interface RootViewController : UIViewController<CalendarViewDelegate>{  CalendarView *calendarView;}@end
【代码笔记】日历

 

RootViewController.m

【代码笔记】日历
#import "RootViewController.h"@interface RootViewController ()@end@implementation RootViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{  self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];  if (self) {    // Custom initialization  }  return self;}- (void)viewDidLoad{  [super viewDidLoad];  // Do any additional setup after loading the view.    self.title=@"Calendar";    [self initWithCalendarView];}-(void)initWithCalendarView{  if(calendarView)    [calendarView removeFromSuperview];  calendarView = [[CalendarView alloc]initWithFrame:CGRectMake(10, self.view.bounds.size.height - 200 - 320 + 20, 300, 300)];  [calendarView refleshriCheng:^(NSDate *date,NSString *str) {    if([str isEqualToString:@"left"]){            UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"点击了左侧按钮" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];      [alert show];    }    else if([str isEqualToString:@"right"]){      UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"点击了右侧按钮" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];      [alert show];    }  }];  calendarView.delegate=self;  [self.view addSubview:calendarView];}#pragma -mark -CalendarViewDelegate- (void) calendarViewDidSelectDate:(NSDate *)date todayDate:(NSDate *)todayDate{    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"提醒" message:@"点击了日期" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];  [alert show];  }- (void)didReceiveMemoryWarning{  [super didReceiveMemoryWarning];  // Dispose of any resources that can be recreated.}
【代码笔记】日历

 

 


 

原标题:【代码笔记】日历

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

海洋节:https://www.goluckyvip.com/tag/33518.html
海洋联盟:https://www.goluckyvip.com/tag/33519.html
海洋日:https://www.goluckyvip.com/tag/33520.html
海邑海外仓:https://www.goluckyvip.com/tag/33521.html
海易海外仓:https://www.goluckyvip.com/tag/33522.html
海翼股份:https://www.goluckyvip.com/tag/33523.html
从园岭新村到大梅沙海滨总站坐什么车:https://www.vstour.cn/a/363191.html
七月份适合去日本旅游吗 7月份去日本哪里好玩:https://www.vstour.cn/a/363192.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流