- download and open my Xcode project linked below
- copy GlossGradientButton files group into your project
- #import "GlossGradientButton.h" into the target View header
- write the following code into the target View implementation :
GlossGradientButton *glossGradientButton =
[[ GlossGradientButton alloc ]
initWithFrame : CGRectMake ( 75 , 164 , 170 , 80 )
withCornerRadius : 20
withTint :
[ UIColor colorWithRed : 0 green : 0.403 blue : 0.813 alpha : 1 ]
withBorderWidth : 1
withBorderColor :
[ UIColor colorWithRed : 0 green : 0.403 blue : 0.813 alpha : 1 ]
withTextColor :
[ UIColor whiteColor ]
withFont :
[ UIFont fontWithName : @"Marker Felt" size : 20 ]];
[glossGradientButton setTitle : @"Tap me!"
forState : UIControlStateNormal ];
[ self . view addSubview :glossGradientButton];
[glossGradientButton release ];
Very useful links:
- http://cocoawithlove.com/2008/09/drawing-gloss-gradients-in-coregraphics.html
- http://howtomakeiphoneapps.com/2009/08/how-to-draw-shapes-with-core-graphics/
- http://github.com/ars/uicolor-utilities
- http://bravobug.com/news/?p=448
- http://forums.macrumors.com/archive/index.php/t-929858.html
- http://stackoverflow.com/questions/2385046/uiview-rounded-corners-question
- http://stackoverflow.com/questions/2503721/how-listen-for-uibutton-state-change
- http://stackoverflow.com/questions/565989/adding-left-button-to-uinavigationbar-iphone
- http://stackoverflow.com/questions/227078/creating-a-left-arrow-button-like- uinavigationbars-back-style-on-a-uitoolbar
0 comments:
Post a Comment