浏览代码

Merge commit '2c7a0ecc3fd4b5fbe991dfe0c076d2382c4ba7f0' into HiBoxde1.0

huangxiaodong 1 年之前
父节点
当前提交
b2881543a6

+ 16 - 4
创维盒子/双子星云手机/Class/Calculator/CalculatorViewController.m

@@ -61,9 +61,20 @@
     UIButton *unableBtn = [[UIButton alloc] init];
     unableBtn.frame = CGRectMake(0, 0, 295, 64);
 
+    NSString * curStr = NSLocalizedString(@"guide_set_open_calcula_guide_tips",nil);
+    CGFloat curHeight = [curStr boundingRectWithSize:CGSizeMake(295 - 20 , 1000) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14.f]} context:nil].size.height;
+    
+    if(curHeight < 50){
+        curHeight = 50;
+    }
+    else{
+        curHeight += 20;
+    }
+    
+    
     // gradient
     CAGradientLayer *gl = [CAGradientLayer layer];
-    gl.frame = CGRectMake(0,0,295,64);
+    gl.frame = CGRectMake(0,0,295,curHeight);
     gl.startPoint = CGPointMake(0, 0.5);
     gl.endPoint = CGPointMake(1, 0.5);
     gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
@@ -71,19 +82,20 @@
     
     [unableBtn.layer addSublayer:gl];
     [unableBtn setUserInteractionEnabled:NO];
-    [unableBtn setTitle:NSLocalizedString(@"guide_set_open_calcula_guide_tips",nil) forState:(UIControlStateNormal)];
+    [unableBtn setTitle:curStr forState:(UIControlStateNormal)];
     [unableBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
     [unableBtn.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
     [unableBtn.titleLabel setNumberOfLines:0];
-    [unableBtn.layer setCornerRadius:32.f];
+    [unableBtn.layer setCornerRadius:curHeight/2.0];
     unableBtn.clipsToBounds = YES;
     [bgView addSubview:unableBtn];
     [unableBtn mas_makeConstraints:^(MASConstraintMaker *make) {
         make.right.mas_equalTo(-20*AUTOSCALE);
         make.width.mas_equalTo(295);
         make.top.equalTo(flagImageView.mas_bottom).offset(-8);
-        make.height.mas_equalTo(64);
+        make.height.mas_equalTo(curHeight);
     }];
+    unableBtn.contentEdgeInsets = UIEdgeInsetsMake(0,10, 0, 10);
     
     UIButton *knowBtn = [[UIButton alloc] init];
     [knowBtn setBackgroundColor:[UIColor clearColor]];

+ 15 - 4
创维盒子/双子星云手机/Class/Controller/HWWebViewController.m

@@ -150,9 +150,19 @@
     UIButton *unableBtn = [[UIButton alloc] init];
     unableBtn.frame = CGRectMake(0, 0, 295, 64);
 
+    NSString * curStr = NSLocalizedString(@"guide_set_open_web_guide_tips",nil);
+    CGFloat curHeight = [curStr boundingRectWithSize:CGSizeMake(295 - 20 , 1000) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:14.f]} context:nil].size.height;
+    
+    if(curHeight < 50){
+        curHeight = 50;
+    }
+    else{
+        curHeight += 20;
+    }
+    
     // gradient
     CAGradientLayer *gl = [CAGradientLayer layer];
-    gl.frame = CGRectMake(0,0,295,64);
+    gl.frame = CGRectMake(0,0,295,curHeight);
     gl.startPoint = CGPointMake(0, 0.5);
     gl.endPoint = CGPointMake(1, 0.5);
     gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
@@ -160,19 +170,20 @@
     
     [unableBtn.layer addSublayer:gl];
     [unableBtn setUserInteractionEnabled:NO];
-    [unableBtn setTitle:NSLocalizedString(@"guide_set_open_web_guide_tips",nil) forState:(UIControlStateNormal)];
+    [unableBtn setTitle:curStr forState:(UIControlStateNormal)];
     [unableBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
     [unableBtn.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
     [unableBtn.titleLabel setNumberOfLines:0];
-    [unableBtn.layer setCornerRadius:32.f];
+    [unableBtn.layer setCornerRadius:curHeight/2.0];
     unableBtn.clipsToBounds = YES;
     [bgView addSubview:unableBtn];
     [unableBtn mas_makeConstraints:^(MASConstraintMaker *make) {
         make.right.mas_equalTo(-20*AUTOSCALE);
         make.width.mas_equalTo(295);
         make.top.equalTo(flagImageView.mas_bottom).offset(-8);
-        make.height.mas_equalTo(64);
+        make.height.mas_equalTo(curHeight);
     }];
+    unableBtn.contentEdgeInsets = UIEdgeInsetsMake(0,10, 0, 10);
     
     UIButton *knowBtn = [[UIButton alloc] init];
     [knowBtn setBackgroundColor:[UIColor clearColor]];