|
|
@@ -6,8 +6,12 @@
|
|
|
//
|
|
|
|
|
|
#import "allVersionView.h"
|
|
|
+#import "MineViewCell.h"
|
|
|
|
|
|
@interface allVersionView ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
+{
|
|
|
+ NSMutableArray*dataArr;
|
|
|
+}
|
|
|
@property(nonatomic,strong)UIView *whiteBgView;
|
|
|
@property(nonatomic,strong)UITableView *tableView;
|
|
|
|
|
|
@@ -24,9 +28,18 @@
|
|
|
}
|
|
|
|
|
|
- (void)drawAnyView{
|
|
|
+
|
|
|
+ dataArr = [NSMutableArray new];
|
|
|
+
|
|
|
+ NSString *str1 = NSLocalizedString(@"my_set_about_version_tap_jingxiang",nil);
|
|
|
+ NSString *str2 = NSLocalizedString(@"my_set_about_version_tap_daili",nil);
|
|
|
+ NSString *str3 = NSLocalizedString(@"my_set_about_version_tap_app",nil);
|
|
|
+ NSString *str4 = NSLocalizedString(@"my_set_about_version_tap_sn",nil);
|
|
|
+
|
|
|
self.backgroundColor = [UIColor hwColor:@"#000000" alpha:0.6];
|
|
|
|
|
|
_whiteBgView = [[UIView alloc] init];
|
|
|
+ _whiteBgView.backgroundColor = [UIColor whiteColor];
|
|
|
_whiteBgView.layer.cornerRadius = 8;
|
|
|
[self addSubview:_whiteBgView];
|
|
|
|
|
|
@@ -39,6 +52,7 @@
|
|
|
|
|
|
UIButton* delBut = [[UIButton alloc] init];
|
|
|
[delBut setImage:[UIImage imageNamed:@"common_del"] forState:UIControlStateNormal];
|
|
|
+ [delBut addTarget:self action:@selector(delViewFun) forControlEvents:UIControlEventTouchUpInside];
|
|
|
[_whiteBgView addSubview:delBut];
|
|
|
|
|
|
[delBut mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
@@ -48,7 +62,27 @@
|
|
|
make.height.mas_equalTo(40.0);
|
|
|
}];
|
|
|
|
|
|
- //UILabel * version
|
|
|
+ UILabel * versionTipLabel = [[UILabel alloc] init];
|
|
|
+ versionTipLabel.text = NSLocalizedString(@"my_set_about_version_tap_tip",nil) ;
|
|
|
+ versionTipLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
+ versionTipLabel.font = [UIFont boldSystemFontOfSize:16.0];
|
|
|
+ [_whiteBgView addSubview:versionTipLabel];
|
|
|
+
|
|
|
+ [versionTipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.top.mas_equalTo(30);
|
|
|
+ make.height.mas_equalTo(20.0);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [_whiteBgView addSubview:self.tableView];
|
|
|
+
|
|
|
+ [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.top.mas_equalTo(versionTipLabel.mas_bottom).offset(10);
|
|
|
+ make.bottom.mas_equalTo(-16.0);
|
|
|
+ }];
|
|
|
}
|
|
|
|
|
|
#pragma mark - 懒加载
|
|
|
@@ -62,9 +96,10 @@
|
|
|
// _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
|
|
|
[_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
|
|
|
[_tableView setSeparatorColor:[UIColor clearColor]];
|
|
|
- [_tableView setBackgroundColor:[UIColor clearColor]];
|
|
|
+ [_tableView setBackgroundColor:[UIColor hwColor:@"#D8D8D8" alpha:1.0]];
|
|
|
[_tableView setTableFooterView:[UIView new]];
|
|
|
[_tableView setBounces:YES];
|
|
|
+ _tableView.layer.cornerRadius = 8;
|
|
|
if (@available(iOS 15.0, *)) {
|
|
|
_tableView.sectionHeaderTopPadding = 0;
|
|
|
}
|
|
|
@@ -73,4 +108,48 @@
|
|
|
|
|
|
return _tableView;
|
|
|
}
|
|
|
+
|
|
|
+- (void)delViewFun
|
|
|
+{
|
|
|
+ [self removeFromSuperview];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - 列表委托
|
|
|
+
|
|
|
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
+ return dataArr.count;
|
|
|
+}
|
|
|
+
|
|
|
+- (MineViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
+
|
|
|
+ NSInteger row = indexPath.row;
|
|
|
+ static NSString *identifier = @"MineViewCell";
|
|
|
+
|
|
|
+ MineViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
|
|
+ cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
+ if (!cell){
|
|
|
+ cell = [[MineViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
|
|
|
+ [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
|
|
|
+ [cell setBackgroundColor:[UIColor clearColor]];
|
|
|
+ [cell setAccessoryType:(UITableViewCellAccessoryNone)];
|
|
|
+
|
|
|
+ [cell.bgViewLayer removeFromSuperlayer];
|
|
|
+ [cell.titleLabel2 setHidden:NO];
|
|
|
+ [cell.rightImage setHidden:YES];
|
|
|
+ [cell.mImageView setHidden:YES];
|
|
|
+ [cell.lineView setHidden:YES];
|
|
|
+ [cell.maskSwitch setHidden:YES];
|
|
|
+ }
|
|
|
+
|
|
|
+ if(row < dataArr.count){
|
|
|
+ cell.titleLabel.text = dataArr[row];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return cell;
|
|
|
+}
|
|
|
+
|
|
|
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
+ return 60;
|
|
|
+}
|
|
|
@end
|