先上地址: XLPopoverView
用法:
XLPopoverView *pop = [[XLPopoverView alloc] init];
pop.delegate = self;
pop.attachmentView = sender;
pop.dataArray = array;
[pop show];
dataArray
必须为存有XLPopoverCellModel
对象的数组.
attachmentView
即为点击触发的控件,必须继承自UIView
.
代理方法:
- (void)popoverView:(XLPopoverView * _Nonnull)popoverView index:(NSInteger)index ;
效果:
注意事项:
attachmentView
即为点击触发的控件,必须继承自UIView
. 上图中左边C控件为设置了CustomView
的UIBarButtonItem
,由于UIBarButtonItem
继承自NSObject
,所以点击右边系统样式会引起崩溃问题,建议使用自定义CustomView
.