项目介绍:
使用 UIcollectionviewflowlayout 实现了婴儿记录成长故事记录的滑杆。
随着时间的推移,记录了婴儿的成长历程。
实现代码:
[Objective-C] 查看源文件 复制代码
#import "ViewController.h" #import "XKCircleMacros.h" #import "XKPERulerView.h" #import "XKPEBabyTargetDrawView.h" #import "XKPEBabySliderView.h" #import "XKPEBabyScsViewController.h" @interface ViewController ()<ZXPushVCDelegate> @property (nonatomic ,strong)XKPEBabyTargetDrawView *drawView; @property (nonatomic ,strong)XKPERulerView *rulerView; @property (nonatomic ,strong) XKPEBabySliderView *productSlider; @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; self.navigationController.navigationBar.hidden = YES; _drawView = [[XKPEBabyTargetDrawView alloc]initWithFrame:CGRectMake(0,0, XKUIScreenwidth, XKUIScreenheight)]; self.view.backgroundColor =[UIColor colorWithRed:32/255.0 green:180/255.0 blue:230/255.0 alpha:1.0]; // [self.view addSubview:_drawView]; _productSlider = [[XKPEBabySliderView alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 385) Title:@"" MinValue:0 MaxValue:320 Step:1 Unit:@"个月" HasDeleteBtn:NO]; _productSlider.delegateOne =self; [self.view addSubview:_productSlider]; // Do any additional setup after loading the view, typically from a nib. } -(void)PushVC:(UIButton *)sender{ XKPEBabyScsViewController *babyScesVC = [[XKPEBabyScsViewController alloc]init]; babyScesVC.btnTag = [NSString stringWithFormat:@"%ld",(long)sender.tag]; NSInteger tag = sender.tag; if (self.block) { self.block(tag); } NSLog(@"!!!!!!%ld",(long)sender.tag); [self.navigationController pushViewController:babyScesVC animated:YES]; } - (void)returnTag:(RetrunImg)block{ self.block = block; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } @end