123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #import "YOUPAIZYEditUserShowAlertWindow.h"
- #import "UIViewController+TFPresent.h"
- @interface YOUPAIZYEditUserShowAlertWindow ()
- @end
- @implementation YOUPAIZYEditUserShowAlertWindow
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.baseView.hidden = YES;
-
- NSInteger count = _youpaipbtntitleArr.count;
- UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, count * 50.0f + SafeHeight)];
- bgV.backgroundColor = LCSubBkgColor;
-
- [self.view addSubview:bgV];
-
- [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.bottom.offset(0.0f);
- make.height.offset(count * 50.0f + SafeHeight);
- }];
-
- [LCTools clipCorner:UIRectCornerTopLeft|UIRectCornerTopRight View:bgV size:CGSizeMake(20.0f, 20.0f)];
- // NSArray *btntitleArr = @[@"举报",@"拉黑",@"取消"];
- CGFloat btnH = 50.0f;
- for (NSInteger i = 0; i < _youpaipbtntitleArr.count; i ++) {
- UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
- button.frame = CGRectMake(0.0f,i * btnH,KScreenWidth,btnH);
- [button setTitle:_youpaipbtntitleArr[i] forState:UIControlStateNormal];
- button.titleLabel.font = LCFont(15);
- button.backgroundColor = [UIColor clearColor];
- if (i == _youpaipbtntitleArr.count - 1) {
- [button setTitleColor:HexColorFromRGB(0x9F9DA5) forState:UIControlStateNormal];
- }else{
- [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- [button addLineWithColor:[HexColorFromRGB(0x4F4B5B) colorWithAlphaComponent:0.29f] lineRect:CGRectMake(14.0f, btnH - 0.5f, KScreenWidth - 28.0f, 0.5f)];
- }
- button.tag = i + 1;
- [button addTarget:self action:@selector(youpaifselectGenderAction:) forControlEvents:UIControlEventTouchUpInside];
- [bgV addSubview:button];
- }
-
- }
- -(void)youpaifselectGenderAction:(UIButton *)sender
- {
- NSArray *typeArr;
- if (_youpaipbtntitleArr.count == 5) {
- typeArr = @[@"look",@"setprofile",@"change",@"delete",@"cancel"];
- }else{
- typeArr = @[@"look",@"change",@"cancel"];
- }
- [self dismissViewControllerAnimated:YES completion:^{
- [self.youpaipdelegate youpaifimSessionMoreWindowAction:self
- type:typeArr[sender.tag - 1]
- tag:sender.tag
- andUserId:self.youpaipuser_id];
- }];
- }
- @end
|