搜索
您的当前位置:首页正文

iOS 仿QQ组件PopoverView

来源:二三娱乐

用法:

    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 ;

效果:

1.gif

注意事项:attachmentView即为点击触发的控件,必须继承自UIView. 上图中左边C控件为设置了CustomViewUIBarButtonItem,由于UIBarButtonItem继承自NSObject,所以点击右边系统样式会引起崩溃问题,建议使用自定义CustomView.

Top