|
@@ -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]];
|