QLPopView
Troduce
QLPopView 是一个自定义弹框 View,可以自定义显示方向和内容等
Usage
- 弹出一个 Label
UILabel *lable = [[UILabel alloc]initWithFrame:CGRectZero];
lable.text = @"显示文字";
lable.font = [UIFont systemFontOfSize:14.0f];
lable.textColor = [UIColor yellowColor];
[lable sizeToFit];
QLPopView *popView = [QLPopView new];
[popView showAtView:sender contentView:lable];
- 弹出一个 ImageView
UIImageView *imgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"timg.jpeg"]];
QLPopView *popView = [QLPopView new];
[popView showAtPoint:CGPointMake(sender.center.x, CGRectGetMaxY(sender.frame)) dirction:QLPop_Direction_Down contentView:imgView containerView:self.view];
- 弹出一个 TableView
QLPopTableView *popTableView = [QLPopTableView new];
NSArray *array = @[
[QLPopItemModel itemWithItemName:@"银行1" itemImage:[UIImage imageNamed:@"bank_0"]],
[QLPopItemModel itemWithItemName:@"银行2" itemImage:[UIImage imageNamed:@"bank_1"]],
[QLPopItemModel itemWithItemName:@"银行3" itemImage:[UIImage imageNamed:@"bank_2"]],
];
[popTableView showAtView:sender rowHeight:44 items:array selectBlock:^(NSInteger index) {
NSLog(@"选择了--%zd",index);
}];
Example
使用情况请见我的 Demo 仓库。其中还包含其他库
Installation
QLPopView 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中
pod 'QLPopView'
作者
paramita, [email protected]
许可协议
QLPopView 在 MIT 许可协议下可用。更多信息请参阅 LICENSE 文件。