diff --git a/src/TapkuLibrary/TKEmptyView.h b/src/TapkuLibrary/TKEmptyView.h index 2afd5272..b5c0855d 100644 --- a/src/TapkuLibrary/TKEmptyView.h +++ b/src/TapkuLibrary/TKEmptyView.h @@ -106,6 +106,8 @@ typedef enum { /** The secondary message. */ @property (strong,nonatomic) UILabel *subtitleLabel; +@property (nonatomic,strong) NSArray* maskGradientColors; + ///------------------------- diff --git a/src/TapkuLibrary/TKEmptyView.m b/src/TapkuLibrary/TKEmptyView.m index 2439ac57..30820625 100644 --- a/src/TapkuLibrary/TKEmptyView.m +++ b/src/TapkuLibrary/TKEmptyView.m @@ -139,7 +139,11 @@ - (id) initWithFrame:(CGRect)frame mask:(UIImage*)image title:(NSString*)titleSt _imageView = [[UIImageView alloc] initWithImage:[self maskedImageWithImage:image]]; _imageView.frame = CGRectMake((int)(frame.size.width/2)-(_imageView.frame.size.width/2), (int)(frame.size.height/2)-(_imageView.frame.size.height/2), _imageView.image.size.width, _imageView.image.size.height); - + + + self.maskGradientColors = [NSArray arrayWithObjects: + [UIColor colorWithRed:174/255.0 green:182/255.0 blue:195/255.0 alpha:1], + [UIColor colorWithRed:197/255.0 green:202/255.0 blue:211/255.0 alpha:1],nil]; [self addSubview:_imageView]; [self addSubview:_subtitleLabel]; @@ -186,11 +190,8 @@ - (UIImage*) maskedImageWithImage:(UIImage*)m{ UIGraphicsBeginImageContext(CGSizeMake((m.size.width)*m.scale , (m.size.height+2)*m.scale)); CGContextRef context = UIGraphicsGetCurrentContext(); - - NSArray *colors = [NSArray arrayWithObjects: - [UIColor colorWithRed:174/255.0 green:182/255.0 blue:195/255.0 alpha:1], - [UIColor colorWithRed:197/255.0 green:202/255.0 blue:211/255.0 alpha:1],nil]; + NSArray* colors = self.maskGradientColors; CGContextSetShadowWithColor(context, CGSizeMake(1, 4),4, [UIColor colorWithWhite:0 alpha:0.1].CGColor); [m drawInRect:CGRectMake(0, 0+(1*m.scale),m.size.width*m.scale, m.size.height*m.scale)];