123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- //
- // previewVideoLandscapeTopMoreView.m
- // 双子星云手机
- //
- // Created by xd h on 2024/7/13.
- //
- #import "previewVideoLandscapeTopMoreView.h"
- @implementation previewVideoLandscapeTopMoreView
- - (id)initWithFrame:(CGRect)frame{
- self = [super initWithFrame:frame];
-
- self.backgroundColor = [UIColor hwColor:@"#000000" alpha:0.1];
- [self drawAnyView];
-
- return self;
- }
- -(void)drawAnyView
- {
- //大按钮响应
- UIButton *bigRightButton = [[UIButton alloc] init];
- bigRightButton.tag = 1;
- [bigRightButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
- [self addSubview:bigRightButton];
- //bigRightButton.backgroundColor= [UIColor greenColor];
-
- [bigRightButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(0);
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.bottom.mas_equalTo(0);
- }];
-
- UIView *whiteBgView = [[UIView alloc] init];
- whiteBgView.backgroundColor = [UIColor hwColor:@"#1E1E1E" alpha:0.9];
- [self addSubview:whiteBgView];
- whiteBgView.layer.cornerRadius = 8;
- whiteBgView.layer.masksToBounds = YES;
-
- [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(0);
- make.right.mas_equalTo(10);
- make.width.mas_equalTo(310+10);
- make.bottom.mas_equalTo(0);
- //make.height.mas_equalTo(150);
- }];
-
-
- UILabel *moreLabel =[[UILabel alloc] init];
- moreLabel.text = NSLocalizedString(@"NAS_preview_video_more_tip",nil);
- moreLabel.textColor = [UIColor whiteColor];
- moreLabel.font = [UIFont boldSystemFontOfSize:14.0];
- [whiteBgView addSubview:moreLabel];
-
- [moreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(15);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(20);
- make.top.mas_equalTo(20);
- }];
-
-
- NSArray *butImageArr = @[@"nas_preview_share_white",@"edit_download_white_icon",@"edit_del_white_icon"];
-
- NSArray *butTextArr = @[NSLocalizedString(@"common_edit_share",nil),
- NSLocalizedString(@"my_set_no_File_download",nil),
- NSLocalizedString(@"File_upload_Record_delete",nil)];
-
- CGFloat butHeight = 40.0;
- CGFloat butTopSpace = 15.0;
-
- for (int i=0; i<butImageArr.count; i++) {
-
- UIButton *but = [[UIButton alloc] init];
- but.tag = 10+i;
- [but addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
- //NSString *butTitle = [[NSString alloc] initWithFormat:@" %@",butTextArr[i]];
- //[but setImage:[UIImage imageNamed:butImageArr[i]] forState:UIControlStateNormal];
- //[but setTitle:butTitle forState:UIControlStateNormal];
- //[but setTitleColor:[UIColor hwColor:@"#0A132B"] forState:UIControlStateNormal];
- //[but setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- //but.titleLabel.font = [UIFont systemFontOfSize:14.0];
-
- but.backgroundColor = [UIColor hwColor:@"#414141" alpha:1.0];
- but.layer.cornerRadius = 8;
- [whiteBgView addSubview:but];
-
- [but mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(15);
- make.right.mas_equalTo(-32 - 10);
- make.height.mas_equalTo(butHeight);
- make.top.mas_equalTo(60 + (butHeight+butTopSpace)*i);
- }];
-
- UIImageView *imageV = [UIImageView new];
- imageV.image = [UIImage imageNamed:butImageArr[i]];
- [but addSubview:imageV];
-
- [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(12);
- make.width.mas_equalTo(24);
- make.height.mas_equalTo(24);
- make.centerY.mas_equalTo(but.mas_centerY);
- }];
-
- UILabel *textLabel =[[UILabel alloc] init];
- textLabel.text = butTextArr[i];
- textLabel.textColor = [UIColor whiteColor];
- textLabel.font = [UIFont systemFontOfSize:12.0];
- [but addSubview:textLabel];
-
- [textLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(imageV.mas_right).offset(8);
- make.right.mas_equalTo(0);
- make.height.mas_equalTo(20);
- make.centerY.mas_equalTo(but.mas_centerY);
- }];
-
- }
- }
- #pragma mark 按钮事件
- - (void)didClickButtonFun:(UIButton*)but
- {
- NSInteger tag = but.tag;
- HLog(@"%ld",tag);
-
- [self removeFun];
-
- if(tag == 1){
- return;
- }
-
- if(_didClickButtonFun){
- _didClickButtonFun(tag);
- }
- }
- - (void)removeFun
- {
- [self removeFromSuperview];
- }
- @end
|