开发中经常会遇到present屏幕,比如我们常用的日历。可以通过view加到window实现,也可以present出一个透明背景的控制器。最近开发了一个支持多选的日历。效果如下

代码如下
MSSCalendarViewController *cvc = [[MSSCalendarViewController alloc]init];
cvc.view.backgroundColor = [UIColor colorWithRed:119/255.0 green:119/255.0 blue:119/255.0 alpha:0.4];
[self presentViewController:cvc animated:YES completion:nil];
分析以后设置一下present的模式,就可以解决背景黑屏的问题
cvc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
cvc.modalPresentationStyle = UIModalPresentationOverFullScreen;
cvc.view.backgroundColor = [UIColor colorWithRed:119/255.0 green:119/255.0 blue:119/255.0 alpha:0.4];
效果如下:

完美解决
本文介绍如何在iOS应用中实现一个支持多选的日历视图,并通过调整present模式来改善用户体验,避免黑屏问题。
3780

被折叠的 条评论
为什么被折叠?



