This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { | |
teamSelector.getViewTreeObserver().removeOnGlobalLayoutListener(this); | |
} else { | |
teamSelector.getViewTreeObserver().removeGlobalOnLayoutListener(this); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (doc, req) { | |
if(doc._deleted){ return true; } | |
//YOUR CUSTOM LOGIC HERE | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CAShapeLayer *layer = [CAShapeLayer layer]; | |
NSUInteger cornersToRound = UIRectCornerTopLeft | UIRectCornerBottomLeft; | |
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds | |
byRoundingCorners:cornersToRound | |
cornerRadii:CGSizeMake(5.0, 5.0)]; | |
layer.path = path.CGPath; | |
self.layer.mask = layer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CAShapeLayer *layer = [CAShapeLayer layer]; | |
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerBottomLeft) cornerRadii:CGSizeMake(5.0, 5.0)]; | |
layer.path = path.CGPath; | |
self.layer.mask = layer; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Setup our fonts - One system font from Apple and a custom font */ | |
CTFontRef bodyCopyFont = CTFontCreateWithName((__bridge CFStringRef) [Theme fontForBodyOfSize:11].fontName, [Theme fontForBodyOfSize:11].lineHeight, NULL); | |
CTFontRef systemFont = CTFontCreateWithName((__bridge CFStringRef) [UIFont systemFontOfSize:11].fontName, [UIFont systemFontOfSize:11].lineHeight, NULL); | |
/* Lets inspect the properties */ | |
NSLog(@"*****************************************************************"); | |
NSLog(@"SYSTEM-FONT LINE HEIGHT PROPERTY %f", [UIFont systemFontOfSize:11].lineHeight); | |
NSLog(@"SYSTEM-FONT CALCULATED LINE HEIGHT %f", [self getLineHeightForFont:systemFont]); //Custom function | |
NSLog(@"*****************************************************************"); | |
NSLog(@"CUSTOM-FONT LINE HEIGHT PROPERTY %f", [Theme fontForBodyOfSize:11].lineHeight); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CGFloat GetLineHeightForFont(CTFontRef iFont) | |
{ | |
CGFloat lineHeight = 0.0; | |
check(iFont != NULL); | |
// Get the ascent from the font, already scaled for the font's size | |
lineHeight += CTFontGetAscent(iFont); | |
// Get the descent from the font, already scaled for the font's size |
NewerOlder