1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // PayAlert.m
- // smartRhino
- //
- // Created by niuzhen on 2020/4/30.
- // Copyright © 2020 tederen. All rights reserved.
- //
- #import "PayAlert.h"
- #import "PayAlertCell.h"
- static UINib *ViewNib = nil;
- @interface PayAlert()<UITableViewDelegate,UITableViewDataSource>
- @end
- @implementation PayAlert
- + (instancetype)share
- {
- if (ViewNib == nil) {
- ViewNib = [UINib nibWithNibName:@"PayAlert" bundle:nil];
- }
- PayAlert *alert = [[ViewNib instantiateWithOwner:nil options:nil] lastObject];
- [alert setTitleColor];
- [alert setFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
- alert.bgColor = [UIColor clearColor];
- alert.tableView.delegate = alert;
- alert.tableView.dataSource = alert;
- [alert.disBtn addTarget:alert action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside];
- alert.Constant.constant = 190 + 30 + 70 * 3;
- [alert.tableView reloadData];
- return alert;
- }
- - (void)setTitleColor
- {
- CAGradientLayer *gradientLayer = [CAGradientLayer layer];
- gradientLayer.colors = @[(__bridge id)UIColorHex(0x51A2DB).CGColor, (__bridge id)UIColorHex(0x73B9EA).CGColor];
- gradientLayer.locations = @[@0.0, @1.0];
- gradientLayer.startPoint = CGPointMake(0, 0);
- gradientLayer.endPoint = CGPointMake(1.0, 0);
- gradientLayer.frame = CGRectMake(0, 0, SCREEN_WIDTH - 32, 40);
- [self.titleView.layer addSublayer:gradientLayer];
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return 3;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- return [PayAlertCell configCellHeight];
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- PayAlertCell * cell = [PayAlertCell configCell:tableView indexPath:indexPath];
- return cell;
- }
- - (void)show
- {
- [super show];
- }
- - (void)dismiss
- {
- [self dismissWithAnimation:kAlertAnimationBottom];
- }
- @end
|