|
@@ -454,25 +454,46 @@
|
|
|
//[[iToast makeText:@"111"] show];
|
|
|
|
|
|
_pwdErrorTip = [[UILabel alloc] init];
|
|
|
+
|
|
|
+ NSString *curTipStr = nil;
|
|
|
if(isNetFail){
|
|
|
- _pwdErrorTip.text = NSLocalizedString(@"log_login_system_busy",nil);
|
|
|
+ curTipStr = NSLocalizedString(@"log_login_system_busy",nil);
|
|
|
}
|
|
|
else{
|
|
|
- _pwdErrorTip.text = NSLocalizedString(@"logo_input_pwd_fail",nil);
|
|
|
+ curTipStr = NSLocalizedString(@"logo_input_pwd_fail",nil);
|
|
|
}
|
|
|
|
|
|
+ _pwdErrorTip.text = curTipStr;
|
|
|
+ _pwdErrorTip.numberOfLines = 0;
|
|
|
_pwdErrorTip.textAlignment = NSTextAlignmentCenter;
|
|
|
_pwdErrorTip.textColor = [UIColor whiteColor];
|
|
|
+ _pwdErrorTip.font = [UIFont systemFontOfSize:16.0];
|
|
|
_pwdErrorTip.backgroundColor = [UIColor hwColor:@"000000" alpha:0.7];
|
|
|
[self.view addSubview:_pwdErrorTip];
|
|
|
|
|
|
_pwdErrorTip.layer.masksToBounds = YES;
|
|
|
_pwdErrorTip.layer.cornerRadius = 10;
|
|
|
|
|
|
+ CGSize curSize = [curTipStr boundingRectWithSize:CGSizeMake(SCREEN_W - 20 - 20 -20, 1000) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16.0]} context:nil].size;
|
|
|
+
|
|
|
+ CGFloat curWidth = curSize.width;
|
|
|
+ CGFloat curheight = curSize.height;
|
|
|
+
|
|
|
+ if(curWidth < (SCREEN_W - 20 - 20)){
|
|
|
+ curWidth += 20;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(curheight < 30){
|
|
|
+ curheight = 40;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ curheight += 10;
|
|
|
+ }
|
|
|
+
|
|
|
[_pwdErrorTip mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.center.mas_equalTo(0);
|
|
|
- make.width.mas_equalTo(200);
|
|
|
- make.height.mas_equalTo(40.f);
|
|
|
+ make.width.mas_equalTo(curWidth);
|
|
|
+ make.height.mas_equalTo(curheight);
|
|
|
}];
|
|
|
|
|
|
///
|