ckteebe / CustomBadge

CustomBadge is an Objective-C based component to create customized Badges for any given View.
http://saschapaulus.de/opensource
MIT License
397 stars 132 forks source link

CustomBadge how to clear shadows #16

Closed arishanapalli closed 9 years ago

arishanapalli commented 9 years ago

badge_cart = [CustomBadge customBadgeWithString:[NSString stringWithFormat:@"%d",countValue] withStringColor:[UIColor whiteColor] withInsetColor:[UIColor redColor] withBadgeFrame:NO withBadgeFrameColor:[UIColor clearColor] withScale:0.8 withShining:NO withFrame:CGRectMake(15, -10, 10, 10)]; badge_cart.tag = 10; [badge_cart.layer setShadowColor:[UIColor clearColor].CGColor]; [badge_cart setBackgroundColor:[UIColor clearColor]]; [Btn_Cart addSubview:badge_cart];

button added on cart there is a small shadow created by custom badge when look very closely to it i want to remove the shadow which created by CustomBadge view. For Information please find the below image. custombatchissue

ckteebe commented 9 years ago

You should use CustomBadge 3.0. Version 3.0 supports separation between rendering and style information (including shadow). The default style which is used by a normal CustomBadge has no shadow. CustomBadge *badge1 = [CustomBadge customBadgeWithString:@"1"];

Of course you can create your own style and turn off the shadow:

BadgeStyle *yourStyle = [BadgeStyle freeStyleWithTextColor:[UIColor whiteColor] withInsetColor:[UIColor blueColor] withFrameColor:nil withFrame:NO withShadow:NO withShining:NO withFontType:BadgeStyleFontTypeHelveticaNeueLight];

Creating a badge with your style:

CustomBadge *badgeWithYourStyle = [CustomBadge customBadgeWithString:@"2" withStyle:yourStyle];

Take a look on the included example project. It has several code examples.

arishanapalli commented 9 years ago

Can you please provide link for CustomBadge 3.0 it still showing 2.0 https://github.com/ckteebe/CustomBadge

ckteebe commented 9 years ago

https://github.com/ckteebe/CustomBadge is the master branch and the current version. Current version is 3.0.

arishanapalli commented 9 years ago

@ckteebe Thank your! I will work on this BadgeStyle its very use full information you provided thanks a lot. happy xmas.