¡@

Home 

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

iphone Programming Glossary: colorwithred

Drawing rotated text with NSString drawInRect

http://stackoverflow.com/questions/10289898/drawing-rotated-text-with-nsstring-drawinrect

context CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB Create the gradient CGColorRef startColor UIColor colorWithRed 1.0 green 1.0 blue 1.0 alpha 1.0 .CGColor CGColorRef endColor UIColor colorWithRed 200.0 255.0 green 200.0 255.0 blue 200.0.. CGColorRef startColor UIColor colorWithRed 1.0 green 1.0 blue 1.0 alpha 1.0 .CGColor CGColorRef endColor UIColor colorWithRed 200.0 255.0 green 200.0 255.0 blue 200.0 255.0 alpha 1.0 .CGColor NSArray colors NSArray arrayWithObjects id startColor..

How would I tint an image programatically on the iPhone?

http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone

rect CGContextRef context UIGraphicsGetCurrentContext CGContextSetFillColor context CGColorGetComponents UIColor colorWithRed 0.5 green 0.5 blue 0 alpha 1 .CGColor don't make color too saturated CGContextFillRect context rect draw base UIImage imageNamed..

How can I create a UIColor from a hex string?

http://stackoverflow.com/questions/1560081/how-can-i-create-a-uicolor-from-a-hex-string

Just include it in your header and it's available throughout your project. #define UIColorFromRGB rgbValue UIColor colorWithRed float rgbValue 0xFF0000 16 255.0 green float rgbValue 0xFF00 8 255.0 blue float rgbValue 0xFF 255.0 alpha 1.0 uicolor macro..

iPhone UITableView - Delete Button

http://stackoverflow.com/questions/2104403/iphone-uitableview-delete-button

topLabel.backgroundColor UIColor clearColor topLabel.textColor fontColor topLabel.highlightedTextColor UIColor colorWithRed 1.0 green 1.0 blue 0.9 alpha 1.0 topLabel.font UIFont systemFontOfSize UIFont labelFontSize Create the label for the top.. UIColor clearColor bottomLabel.textColor fontColor bottomLabel.highlightedTextColor UIColor colorWithRed 1.0 green 1.0 blue 0.9 alpha 1.0 bottomLabel.font UIFont systemFontOfSize UIFont labelFontSize 2 Create a background image..

UISegmentedControl selected segment color

http://stackoverflow.com/questions/2270526/uisegmentedcontrol-selected-segment-color

for int i 0 i sender.subviews count i if sender.subviews objectAtIndex i isSelected UIColor tintcolor UIColor colorWithRed 127.0 255.0 green 161.0 255.0 blue 183.0 255.0 alpha 1.0 sender.subviews objectAtIndex i setTintColor tintcolor else sender.subviews..

How to change an UILabel/UIFont's letter spacing?

http://stackoverflow.com/questions/2544905/how-to-change-an-uilabel-uifonts-letter-spacing

stringWithFormat @ d total totalColors.font UIFont fontWithName @ Arial BoldMT size 60 totalColors.textColor UIColor colorWithRed 221 255.0 green 221 255.0 blue 221 255.0 alpha 1.0 totalColors.backgroundColor UIColor clearColor self addSubview totalColors..

How to tint UIBarButtonItem background color?

http://stackoverflow.com/questions/3274473/how-to-tint-uibarbuttonitem-background-color

background color I have a UIToolbar that contains 2 buttons. The toolbar has a tint toolbar.tintColor UIColor colorWithRed 102.0 255.0 green 20.0 255.0 blue 11.0 255.0 alpha 1 How can I make the buttons have a similar tint color iphone objective..

Adding a UILabel to a UIToolbar

http://stackoverflow.com/questions/333441/adding-a-uilabel-to-a-uitoolbar

@ Helvetica Bold size 18 self.titleLabel setBackgroundColor UIColor clearColor self.titleLabel setTextColor UIColor colorWithRed 157.0 255.0 green 157.0 255.0 blue 157.0 255.0 alpha 1.0 self.titleLabel setText @ Title self.titleLabel setTextAlignment..

How to convert HEX RGB color codes to UIColor?

http://stackoverflow.com/questions/3805177/how-to-convert-hex-rgb-color-codes-to-uicolor

NSString hexString float red green blue alpha SKScanHexColor hexString red green blue alpha return UIColor colorWithRed red green green blue blue alpha alpha If you prefer to use this as a UIColor category then it's just a matter of altering..

Inner shadow effect on UIView layer?

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

context visiblePath CGContextClip context Now setup the shadow properties on the context aColor UIColor colorWithRed 0.0f green 0.0f blue 0.0f alpha 0.5f CGContextSaveGState context CGContextSetShadowWithColor context CGSizeMake 0.0f 1.0f..

UITextView ruled line background but wrong line height

http://stackoverflow.com/questions/5375350/uitextview-ruled-line-background-but-wrong-line-height

NoteView id initWithFrame CGRect frame self super initWithFrame frame if self self.backgroundColor UIColor colorWithRed 1.0f green 1.0f blue 0.6f alpha 1.0f self.font UIFont fontWithName @ MarkerFelt Thin size 19 return self void drawRect CGRect.. context UIGraphicsGetCurrentContext Set the line color and width CGContextSetStrokeColorWithColor context UIColor colorWithRed 0.0f green 0.0f blue 0.0f alpha 0.2f .CGColor CGContextSetLineWidth context 1.0f Start a new Path CGContextBeginPath context..

How to get click event from a button added over MKAnnotationView

http://stackoverflow.com/questions/6941199/how-to-get-click-event-from-a-button-added-over-mkannotationview

UIButton pinButton UIButton alloc initWithFrame CGRectMake 0 0 140 28 pinButton.titleLabel setTextColor UIColor colorWithRed 255 255.0 green 255 255.0 blue 255 255.0 alpha 1 pinButton setCenter CGPointMake pinAnnotationView.center.x 70 pinAnnotationView.center.y..

Customization of UINavigationBar and the back button

http://stackoverflow.com/questions/7066874/customization-of-uinavigationbar-and-the-back-button

button setTitleEdgeInsets UIEdgeInsetsMake margin marginLeft margin marginRight button setTitleColor UIColor colorWithRed 53.0f 255.0f green 77.0f 255.0f blue 99.0f 255.0f alpha 1.0f forState UIControlStateNormal return UIBarButtonItem alloc.. title target target selector selector button.titleLabel.textColor UIColor blackColor button setTitleColor UIColor colorWithRed 53.0f 255.0f green 77.0f 255.0f blue 99.0f 255.0f alpha 1.0f forState UIControlStateNormal return UIBarButtonItem alloc..

Setting background color of a table view cell on iPhone

http://stackoverflow.com/questions/900094/setting-background-color-of-a-table-view-cell-on-iphone

UITableViewCell cell forRowAtIndexPath NSIndexPath indexPath cell.backgroundColor indexPath.row 2 UIColor colorWithRed 0.0 green 0.0 blue 1.0 alpha 1.0 UIColor whiteColor cell.textLabel.backgroundColor UIColor clearColor cell.detailTextLabel.backgroundColor..

How to Pause/Play NSTimer?

http://stackoverflow.com/questions/9975562/how-to-pause-play-nstimer

isEqualToString @ Pause startStop setTitle @ Resume forState UIControlStateNormal startStop setTitleColor UIColor colorWithRed 0 255 green 0 255 blue 255 255 alpha 1.0 forState UIControlStateNormal pauseStart NSDate dateWithTimeIntervalSinceNow 0..