¡@

Home 

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

iphone Programming Glossary: cgrectgetmidx

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

rgbColorspace components locations num_locations CGRect currentBounds self.bounds CGPoint topCenter CGPointMake CGRectGetMidX currentBounds 0.0f CGPoint midCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds CGContextDrawLinearGradient.. currentBounds self.bounds CGPoint topCenter CGPointMake CGRectGetMidX currentBounds 0.0f CGPoint midCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds CGContextDrawLinearGradient context gradient topCenter midCenter 0 CGGradientRelease..

Drag UIView around Shape Comprised of CGMutablePaths

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

CGFloat const radius 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..

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

self.bounds CGFloat dotsWidth self.numberOfPages 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.. kDotSpacer CGFloat dotSpanY kDotDiameter kDotSpacer CGRect currentBounds 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..

How to fill a path with gradient in drawRect:?

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

context CGContextAddEllipseInRect context rect CGContextClip context CGPoint startPoint CGPointMake CGRectGetMidX rect CGRectGetMinY rect CGPoint endPoint CGPointMake CGRectGetMidX rect CGRectGetMaxY rect CGContextDrawLinearGradient context.. context CGPoint startPoint CGPointMake CGRectGetMidX rect CGRectGetMinY rect CGPoint endPoint CGPointMake CGRectGetMidX rect CGRectGetMaxY rect CGContextDrawLinearGradient context gradient startPoint endPoint 0 CGGradientRelease gradient gradient..

Twitter-esque UITabBarController?

http://stackoverflow.com/questions/3664208/twitter-esque-uitabbarcontroller

NSOrderedAscending On iOS 5 otherwise use old index isUsingVersionFive YES Then instead of this CGFloat tabMiddle CGRectGetMidX self tabBar subviews objectAtIndex index frame ... I use this CGFloat tabMiddle CGRectGetMidX self tabBar subviews objectAtIndex.. this CGFloat tabMiddle CGRectGetMidX self tabBar subviews objectAtIndex index frame ... I use this CGFloat tabMiddle CGRectGetMidX self tabBar subviews objectAtIndex index isUsingVersionFive 1 0 frame Still holding out on the bounty though in case I get..

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

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

FONT SIZE CGFloat fontCapHeightHalf self.font.capHeight 2 5 CGRect currentBounds rect CGPoint topCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds fontCapHeightHalf CGPoint midCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY.. CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds fontCapHeightHalf CGPoint midCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds fontCapHeightHalf CGContextDrawLinearGradient myContext glossGradient topCenter..

Find a point, a given distance, along a simple cubic bezier curve. (On an iPhone!)

http://stackoverflow.com/questions/4058979/find-a-point-a-given-distance-along-a-simple-cubic-bezier-curve-on-an-iphone

MBBezierView void drawRect CGRect rect CGPoint p1 p2 p3 p4 p1 CGPointMake 30 rect.size.height 0.33 p2 CGPointMake CGRectGetMidX rect CGRectGetMinY rect p3 CGPointMake CGRectGetMidX rect CGRectGetMaxY rect p4 CGPointMake 30 CGRectGetMaxX rect rect.size.height.. p2 p3 p4 p1 CGPointMake 30 rect.size.height 0.33 p2 CGPointMake CGRectGetMidX rect CGRectGetMinY rect p3 CGPointMake CGRectGetMidX rect CGRectGetMaxY rect p4 CGPointMake 30 CGRectGetMaxX rect rect.size.height 0.66 UIColor blackColor set UIBezierPath bezierPathWithRect..

Find the tangent of a point on a cubic bezier curve (on an iPhone)

http://stackoverflow.com/questions/4089443/find-the-tangent-of-a-point-on-a-cubic-bezier-curve-on-an-iphone

MBBezierView void drawRect CGRect rect CGPoint p1 p2 p3 p4 p1 CGPointMake 30 rect.size.height 0.33 p2 CGPointMake CGRectGetMidX rect CGRectGetMinY rect p3 CGPointMake CGRectGetMidX rect CGRectGetMaxY rect p4 CGPointMake 30 CGRectGetMaxX rect rect.size.height.. p2 p3 p4 p1 CGPointMake 30 rect.size.height 0.33 p2 CGPointMake CGRectGetMidX rect CGRectGetMinY rect p3 CGPointMake CGRectGetMidX rect CGRectGetMaxY rect p4 CGPointMake 30 CGRectGetMaxX rect rect.size.height 0.66 UIColor blackColor set UIBezierPath bezierPathWithRect..

Round two corners in UIView

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

CGColorSpaceRelease colorSpace if context NULL return NULL cerate mask CGFloat minx CGRectGetMinX rect midx CGRectGetMidX rect maxx CGRectGetMaxX rect CGFloat miny CGRectGetMinY rect midy CGRectGetMidY rect maxy CGRectGetMaxY rect CGContextBeginPath..

iPhone Glossy Icons Using Core Graphics

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

context 20 0 CGContextAddLineToPoint context 20 quarterHeight CGContextAddQuadCurveToPoint context CGRectGetMidX rect quarterHeight 3 CGRectGetMaxX rect 20 quarterHeight CGContextAddLineToPoint context CGRectGetMaxX rect 20 0 CGContextClosePath.. rgbColorspace CGRect currentBounds CGRectMake 0 0 icon.size.width icon.size.height CGPoint topCenter CGPointMake CGRectGetMidX currentBounds 0.0f CGPoint midCenter CGPointMake CGRectGetMidX currentBounds CGRectGetMidY currentBounds CGFloat locations.. icon.size.height CGPoint 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..

iPhone Core Animation - Drawing a Circle

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

0 0 2.0 radius 2.0 radius cornerRadius 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..