iOS开发底部弹出年月日选择器的使用代码,不多说了直接看代码吧:
//初始化sheet vc
BottomPickerViewController *sheet = [BottomPickerViewController new];
//设置标题
sheet.titleLab = title;
sheet.delegate = _delegate;
//选择你要展示的时间样式
sheet.modeNum = modeNum;
sheet.indexPath = [NSIndexPath indexPathForRow:row inSection:section];
sheet.minDate = [NSDate date];
// sheet.view.tag = 1001;
//sheet nav 设置
[STPopupNavigationBar appearance].barTintColor = [AppDelegate UIColorFromRGB:0x0D3B73];
[STPopupNavigationBar appearance].tintColor = [UIColor whiteColor];
[STPopupNavigationBar appearance].barStyle = UIBarStyleDefault;
[STPopupNavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]};
//初始化sheet popup
STPopupController *popupController = [[STPopupController alloc] initWithRootViewController:sheet];
popupController.containerView.layer.cornerRadius = 4;
popupController.style = STPopupStyleBottomSheet;
[popupController presentInViewController:_SuperVC];
效果图如下:
下载对应的资源文件地址:点击打开链接