美文网首页好东西小知识点
iOS 仿QQ组件PopoverView

iOS 仿QQ组件PopoverView

作者: 魔鬼分界线 | 来源:发表于2017-09-05 09:26 被阅读182次

先上地址: 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 ;

效果:

1.gif

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

相关文章

网友评论

    本文标题:iOS 仿QQ组件PopoverView

    本文链接:https://www.haomeiwen.com/subject/aytujxtx.html