¡@

Home 

2014/10/15 ¤U¤È 10:05:05

iphone Programming Glossary: cgrectgetmidy

How do I add a gradient to the text of a UILabel, but not the background?

http://stackoverflow.com/questions/1266179/how-do-i-add-a-gradient-to-the-text-of-a-uilabel-but-not-the-background

topCenter CGPointMake CGRectGetMidX currentBounds 0.0f CGPoint midCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds CGContextDrawLinearGradient context gradient topCenter midCenter 0 CGGradientRelease gradient CGColorSpaceRelease..

Drag UIView around Shape Comprised of CGMutablePaths

http://stackoverflow.com/questions/13664615/drag-uiview-around-shape-comprised-of-cgmutablepaths

bounds.size.height 6 CGFloat const offset 2 radius M_SQRT1_2 CGPoint const topCenter CGPointMake CGRectGetMidX bounds CGRectGetMidY bounds offset CGPoint const bottomCenter topCenter.x CGRectGetMidY bounds offset path_ UIBezierPath bezierPath path_ addArcWithCenter.. const topCenter CGPointMake CGRectGetMidX bounds CGRectGetMidY bounds offset CGPoint const bottomCenter topCenter.x CGRectGetMidY bounds offset path_ UIBezierPath bezierPath path_ addArcWithCenter topCenter radius radius startAngle M_PI_4 endAngle M_PI..

How can i change the color of pagination dots of UIPageControl?

http://stackoverflow.com/questions/2942636/how-can-i-change-the-color-of-pagination-dots-of-uipagecontrol

kDotDiameter MAX 0 self.numberOfPages 1 kDotSpacer CGFloat x CGRectGetMidX currentBounds dotsWidth 2 CGFloat y CGRectGetMidY currentBounds kDotDiameter 2 for int i 0 i _numberOfPages i CGRect circleRect CGRectMake x y kDotDiameter kDotDiameter.. self.bounds CGFloat x touchPoint.x dotSpanX 2 CGRectGetMidX currentBounds CGFloat y touchPoint.y dotSpanY 2 CGRectGetMidY currentBounds if x 0 x dotSpanX y 0 y dotSpanY return self.currentPage floor x kDotDiameter kDotSpacer if self.delegate..

How to get UILabel (UITextView) auto adjusted font size?

http://stackoverflow.com/questions/3669844/how-to-get-uilabel-uitextview-auto-adjusted-font-size

self.font.capHeight 2 5 CGRect currentBounds rect CGPoint topCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds fontCapHeightHalf CGPoint midCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds fontCapHeightHalf.. currentBounds CGRectGetMidY currentBounds fontCapHeightHalf CGPoint midCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds fontCapHeightHalf CGContextDrawLinearGradient myContext glossGradient topCenter midCenter 0 CGGradientRelease..

How to make a CATransform3dMakeRotation rotate the other way? And chain together

http://stackoverflow.com/questions/3799194/how-to-make-a-catransform3dmakerotation-rotate-the-other-way-and-chain-together

numberWithFloat 2.0f forKey kCATransactionAnimationDuration myCard.position CGPointMake CGRectGetMidX self.bounds 2 CGRectGetMidY self.bounds 2 myCard.transform CATransform3DMakeRotation M_PI 1 0 0 CATransaction commit A second question would be how.. numberWithFloat 2.0f forKey kCATransactionAnimationDuration myCard.position CGPointMake CGRectGetMidX self.bounds 2 CGRectGetMidY self.bounds 2 myCard.transform CATransform3DMakeRotation M_PI 1 0 0 rotate about x CATransaction begin CATransaction setValue.. t 2 forKey kCATransactionAnimationDuration myCard.position CGPointMake CGRectGetMidX self.view.bounds 2 CGRectGetMidY self.view.bounds 2 UIView beginAnimations nil context nil UIView setAnimationDuration t myCard.transform CATransform3DMakeRotation..

Round two corners in UIView

http://stackoverflow.com/questions/4847163/round-two-corners-in-uiview

CGFloat minx CGRectGetMinX rect midx CGRectGetMidX rect maxx CGRectGetMaxX rect CGFloat miny CGRectGetMinY rect midy CGRectGetMidY rect maxy CGRectGetMaxY rect CGContextBeginPath context CGContextSetGrayFillColor context 1.0 0.0 CGContextAddRect context..

iPhone Glossy Icons Using Core Graphics

http://stackoverflow.com/questions/5541457/iphone-glossy-icons-using-core-graphics

context CGContextRestoreGState context static void addGlossPath CGContextRef context CGRect rect CGFloat quarterHeight CGRectGetMidY rect 2 CGContextSaveGState context CGContextBeginPath context CGContextMoveToPoint context 20 0 CGContextAddLineToPoint.. topCenter CGPointMake CGRectGetMidX currentBounds 0.0f CGPoint midCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds CGFloat locations 2 0.0 1.0 CGFloat components 8 1.0 1.0 1.0 0.75 1.0 1.0 1.0 0.2 UIGraphicsBeginImageContext..

How to draw a triangle programmatically

http://stackoverflow.com/questions/6697614/how-to-draw-a-triangle-programmatically

CGContextMoveToPoint ctx CGRectGetMinX rect CGRectGetMinY rect top left CGContextAddLineToPoint ctx CGRectGetMaxX rect CGRectGetMidY rect mid right CGContextAddLineToPoint ctx CGRectGetMinX rect CGRectGetMaxY rect bottom left CGContextClosePath ctx CGContextSetRGBFillColor..

iPhone Core Animation - Drawing a Circle

http://stackoverflow.com/questions/7991086/iphone-core-animation-drawing-a-circle

radius .CGPath Center the shape in self.view circle.position CGPointMake CGRectGetMidX self.view.frame radius CGRectGetMidY self.view.frame radius Configure the apperence of the circle circle.fillColor UIColor clearColor .CGColor circle.strokeColor..

Capturing zoomed preview view in AVFoundation

http://stackoverflow.com/questions/8150148/capturing-zoomed-preview-view-in-avfoundation

self avCaptureVideoPreviewLayer setBounds layerRect self previewLayer setPosition CGPointMake CGRectGetMidX layerRect CGRectGetMidY layerRect add the video previewview layer to the preview view previewView layer addSublayer self avCaptureVideoPreviewLayer..