¡@

Home 

2014/10/15 ¤U¤È 10:13:57

iphone Programming Glossary: setfill

iPhone UITextField - Change placeholder text color

http://stackoverflow.com/questions/1340224/iphone-uitextfield-change-placeholder-text-color

How to fill a path with gradient in drawRect:?

http://stackoverflow.com/questions/2985359/how-to-fill-a-path-with-gradient-in-drawrect

pointValue in points aPoint pointValue CGPointValue CGContextAddLineToPoint context aPoint.x aPoint.y UIColor redColor setFill UIColor blackColor setStroke CGContextDrawPath context kCGPathFillStroke I'd like to draw a gradient instead of solid red..

Inner Shadow in UILabel

http://stackoverflow.com/questions/3231690/inner-shadow-in-uilabel

UIImage blackSquareOfSize CGSize size UIGraphicsBeginImageContextWithOptions size NO 0 UIColor blackColor setFill CGContextFillRect UIGraphicsGetCurrentContext CGRectMake 0 0 size.width size.height UIImage blackSquare UIGraphicsGetImageFromCurrentImageContext.. CGSize fontSize text_ sizeWithFont font CGImageRef mask self createMaskWithSize rect.size shape ^ UIColor blackColor setFill CGContextFillRect UIGraphicsGetCurrentContext rect UIColor whiteColor setFill custom shape goes here text_ drawAtPoint CGPointMake.. rect.size shape ^ UIColor blackColor setFill CGContextFillRect UIGraphicsGetCurrentContext rect UIColor whiteColor setFill custom shape goes here text_ drawAtPoint CGPointMake self.bounds.size.width 2 fontSize.width 2 0 withFont font text_ drawAtPoint..

How to tint a transparent PNG image in iPhone?

http://stackoverflow.com/questions/3514066/how-to-tint-a-transparent-png-image-in-iphone

background to preserve color of transparent pixels CGContextSetBlendMode context kCGBlendModeNormal UIColor blackColor setFill CGContextFillRect context rect draw original image CGContextSetBlendMode context kCGBlendModeNormal CGContextDrawImage context.. alpha the luminosity of the original image is preserved CGContextSetBlendMode context kCGBlendModeColor tintColor setFill CGContextFillRect context rect mask by alpha values of original image CGContextSetBlendMode context kCGBlendModeDestinationIn.. way around with kCGBlendModeLuminosity draw tint color CGContextSetBlendMode context kCGBlendModeNormal tintColor setFill CGContextFillRect context rect replace luminosity of background ignoring alpha CGContextSetBlendMode context kCGBlendModeLuminosity..

iPhone - Draw transparent rectangle on UIView to reveal view beneath

http://stackoverflow.com/questions/3800278/iphone-draw-transparent-rectangle-on-uiview-to-reveal-view-beneath

look something like this void drawRect CGRect rect Start by filling the area with the blue color UIColor blueColor setFill UIRectFill rect Assume that there's an ivar somewhere called holeRect of type CGRect We could just fill holeRect but it's.. the area we're being asked to draw. CGRect holeRectIntersection CGRectIntersection holeRect rect UIColor clearColor setFill UIRectFill holeRectIntersection If you're using Interface builder make sure to change the holey view's class to HoleyView...

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

bounds.origin.y radius CGPathCloseSubpath visiblePath Fill this path UIColor aColor UIColor redColor aColor setFill CGContextAddPath context visiblePath CGContextFillPath context Now create a larger rectangle which we're going to subtract.. context CGSizeMake 0.0f 1.0f 3.0f aColor CGColor Now fill the rectangle so the shadow gets drawn aColor setFill CGContextSaveGState context CGContextAddPath context path CGContextEOFillPath context Release the paths CGPathRelease path..

How do I detect a touch on a UIBezierPath and move a ball along that?

http://stackoverflow.com/questions/4854035/how-do-i-detect-a-touch-on-a-uibezierpath-and-move-a-ball-along-that

aShape UIBezierPath bezierPathWithOvalInRect CGRectMake 0 0 200 100 UIColor blackColor setStroke UIColor redColor setFill CGContextRef aRef UIGraphicsGetCurrentContext CGContextTranslateCTM aRef 50 50 aShape.lineWidth 5 aShape fill aShape stroke..

Draw glow around inside edge of multiple CGPaths

http://stackoverflow.com/questions/8480401/draw-glow-around-inside-edge-of-multiple-cgpaths

mask.size UIGraphicsBeginImageContextWithOptions rect.size NO mask.scale Fill the entire image with color. color setFill UIRectFill rect Now erase the masked part. CGContextClipToMask UIGraphicsGetCurrentContext rect mask.CGImage CGContextClearRect..