|
|
@@ -62,12 +62,15 @@ static HaveNewVersionView * _instance;
|
|
|
NSString *tipStr = _versionModel.versionInfo;
|
|
|
|
|
|
CGFloat curHeight = [tipStr boundingRectWithSize:CGSizeMake(300 -40, 1000) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0]} context:nil].size.height;
|
|
|
+ CGFloat fullHeight = curHeight + 20;
|
|
|
+ BOOL isNeedScroll = NO;
|
|
|
|
|
|
curHeight += 10;
|
|
|
|
|
|
- if( (curHeight + 280) >= SCREEN_H){
|
|
|
+ if( (curHeight + 380) >= SCREEN_H){
|
|
|
|
|
|
- curHeight = SCREEN_H - 280 - 10;
|
|
|
+ curHeight = SCREEN_H - 380 - 10;
|
|
|
+ isNeedScroll = YES;
|
|
|
}
|
|
|
|
|
|
bgView = [[UIView alloc] init];
|
|
|
@@ -102,13 +105,49 @@ static HaveNewVersionView * _instance;
|
|
|
[tipsLabel setFont:[UIFont systemFontOfSize:13.f]];
|
|
|
//[tipsLabel setTextAlignment:(NSTextAlignmentCenter)];
|
|
|
[tipsLabel setNumberOfLines:0];
|
|
|
- [bgView addSubview:tipsLabel];
|
|
|
- [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.top.equalTo(topImageView.mas_bottom).offset(20.f);
|
|
|
- make.left.mas_equalTo(20);
|
|
|
- make.right.mas_equalTo(-20);
|
|
|
- make.height.mas_equalTo(curHeight);
|
|
|
- }];
|
|
|
+// [bgView addSubview:tipsLabel];
|
|
|
+// [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.top.equalTo(topImageView.mas_bottom).offset(20.f);
|
|
|
+// make.left.mas_equalTo(20);
|
|
|
+// make.right.mas_equalTo(-20);
|
|
|
+// make.height.mas_equalTo(curHeight);
|
|
|
+// }];
|
|
|
+
|
|
|
+
|
|
|
+ //可能文字超出
|
|
|
+ UIScrollView *bgScorllV = [[UIScrollView alloc] init];
|
|
|
+ //bgScorllV.showsHorizontalScrollIndicator = NO;
|
|
|
+ //bgScorllV.backgroundColor = [UIColor greenColor];
|
|
|
+ if(isNeedScroll){
|
|
|
+
|
|
|
+ [bgView addSubview:bgScorllV];
|
|
|
+ [bgScorllV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(topImageView.mas_bottom).offset(20.f);
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.height.mas_equalTo(curHeight);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [bgScorllV addSubview:tipsLabel];
|
|
|
+ [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.mas_equalTo(0);
|
|
|
+ make.left.mas_equalTo(20);
|
|
|
+ //make.right.mas_equalTo(-20);
|
|
|
+ make.width.mas_equalTo(260);
|
|
|
+ make.height.mas_equalTo(fullHeight);
|
|
|
+ }];
|
|
|
+
|
|
|
+ bgScorllV.contentSize = CGSizeMake(300, fullHeight);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [bgView addSubview:tipsLabel];
|
|
|
+ [tipsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(topImageView.mas_bottom).offset(20.f);
|
|
|
+ make.left.mas_equalTo(20);
|
|
|
+ make.right.mas_equalTo(-20);
|
|
|
+ make.height.mas_equalTo(curHeight);
|
|
|
+ }];
|
|
|
+ }
|
|
|
|
|
|
/*删除按钮*/
|
|
|
deleteBtn = [[UIButton alloc] init];
|
|
|
@@ -127,15 +166,15 @@ static HaveNewVersionView * _instance;
|
|
|
deleteBtn.hidden = YES;
|
|
|
|
|
|
// 分割线
|
|
|
- UIView *line = [[UIView alloc] init];
|
|
|
- line.backgroundColor = HWCCCCCCColor;
|
|
|
- [bgView addSubview:line];
|
|
|
- [line mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.left.mas_equalTo(0);
|
|
|
- make.right.mas_equalTo(0);
|
|
|
- make.height.mas_equalTo(1);
|
|
|
- make.bottom.mas_equalTo(-92);
|
|
|
- }];
|
|
|
+// UIView *line = [[UIView alloc] init];
|
|
|
+// line.backgroundColor = HWCCCCCCColor;
|
|
|
+// [bgView addSubview:line];
|
|
|
+// [line mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.left.mas_equalTo(0);
|
|
|
+// make.right.mas_equalTo(0);
|
|
|
+// make.height.mas_equalTo(1);
|
|
|
+// make.bottom.mas_equalTo(-92);
|
|
|
+// }];
|
|
|
|
|
|
// /*确定按钮*/
|
|
|
// UIButton *okBtn = [[UIButton alloc] init];
|
|
|
@@ -154,6 +193,21 @@ static HaveNewVersionView * _instance;
|
|
|
// make.bottom.mas_equalTo(-20.f);
|
|
|
// }];
|
|
|
|
|
|
+ /*稍后再说 按钮 app_update_wait*/
|
|
|
+ UIButton *waitBtn = [[UIButton alloc] init];
|
|
|
+ [waitBtn setTitle:NSLocalizedString(@"app_update_wait",nil) forState:(UIControlStateNormal)];
|
|
|
+ [waitBtn setTitleColor:HW666666Color forState:UIControlStateNormal];
|
|
|
+ [waitBtn.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
|
|
|
+ [waitBtn addTarget:self action:@selector(waitBtnPressed) forControlEvents:(UIControlEventTouchUpInside)];
|
|
|
+ [bgView addSubview:waitBtn];
|
|
|
+
|
|
|
+ [waitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(30.f);
|
|
|
+ make.width.mas_equalTo(168.f);
|
|
|
+ make.centerX.equalTo(bgView.mas_centerX);
|
|
|
+ make.bottom.mas_equalTo(-20.f);
|
|
|
+ }];
|
|
|
+
|
|
|
UIButton *updatekBtn = [[UIButton alloc] init];
|
|
|
updatekBtn.frame = CGRectMake(0, 0, 160.f, 48.f);
|
|
|
|
|
|
@@ -176,28 +230,22 @@ static HaveNewVersionView * _instance;
|
|
|
[updatekBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.centerX.equalTo(bgView.mas_centerX);
|
|
|
make.width.mas_equalTo(160.f);
|
|
|
- make.bottom.mas_equalTo(-20.f);
|
|
|
- make.height.mas_equalTo(48.f);
|
|
|
+ make.bottom.equalTo(waitBtn.mas_top).offset(-10);
|
|
|
+ make.height.mas_equalTo(40.f);
|
|
|
}];
|
|
|
|
|
|
-// UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 1, 1) style:(UITableViewStylePlain)];
|
|
|
-// tableView.delegate = self;
|
|
|
-// tableView.dataSource = self;
|
|
|
-// [tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
|
|
|
-// [tableView setSeparatorColor:[UIColor clearColor]];
|
|
|
-// [tableView setBackgroundColor:[UIColor clearColor]];
|
|
|
-// if (@available(iOS 15.0, *)) {
|
|
|
-// tableView.sectionHeaderTopPadding = 0;
|
|
|
-// }
|
|
|
-// [bgView addSubview:tableView];
|
|
|
-// [tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
-// make.left.mas_equalTo(0);
|
|
|
-// make.right.mas_equalTo(0);
|
|
|
-// make.top.mas_equalTo(topImageView.mas_bottom);
|
|
|
-// make.bottom.mas_equalTo(line.mas_top);
|
|
|
-// }];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+- (void)waitBtnPressed
|
|
|
+{
|
|
|
+ [self deleteBtnPressed];
|
|
|
+
|
|
|
+ if(_versionModel.versionNumber){
|
|
|
+ [HWDataManager setObjectWithKey:Const_did_show_version_and_click_wait value:_versionModel.versionNumber];
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
- (void)deleteBtnPressed
|
|
|
{
|
|
|
[self removeFromSuperview];
|