前言
在iOS的app上一般的日期选择器都会选择用 UIDatePicker 来做,但是我之前的产品经理并不喜欢那种选择的模式。说事要统一安卓和iOS的设计风格。这就是我写这个选择器的初衷。

这就是我写的选择器的样式。
如何使用
只要在相应的VC中导入"ZPAlterView.h",然后签代理。

我是在界面上加了一个button,当点击的时候就会弹出选择器。
既然上面签了代理,那么下面就是要实现一下代理方法。
- (void)didClickButtonAtIndex:(NSInteger)currentIndex;
上面的 效果图也看到了,选择器下面有两个 button 那么 这个代理方法就是判断你点的是那个button,从而做出不同的处理。

这样,选择器就基本实现了。
下面是一个gif效果图:

欢迎各位朋友给我提出意见,demo地址
github:https://github.com/cAibDe/Android-Style-PickView
网友评论