使用 UIKit 模仿 Facebook 应用弹窗的弹出视图。
这个弹出视图的概念非常简单:在弹出视图中添加您的 contentView,然后在容器视图中显示弹出视图。
iOS ~> 6.0
DXPopover 通过 CocoaPods 提供。要安装,只需将以下行添加到您的 Podfile 中
pod "DXPopover"
API 和演示非常直接。您可以在演示中查看详细信息。
例如
UIImageView *imageV= [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
imageV.image = [UIImage imageNamed:@"ig20.jpg"];
DXPopover *popover = [DXPopover popover];
[popover showAtView:self.btn1 withContentView:imageV];
例如
[self.popover showAtPoint:yourPoint popoverPostion:DXPopoverPositionDown withContentView:self.tableView inView:self.tabBarController.view]; // 1.Set the show point 2.set The position if up or down staying the showPoint, 3.Your contentView 4.The containerView
__weak typeof(self)weakSelf = self;
self.popover.didDismissHandler = ^{ //The callback of popover dimissal.
[weakSelf bounceTargetView:titleView];
};
DXPopover 可在 MIT 许可下使用。有关更多信息,请参阅 LICENSE 文件。