Created
November 19, 2012 15:05
-
-
Save piaoapiao/4111158 to your computer and use it in GitHub Desktop.
uibutton
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <QuartzCore/QuartzCore.h> | |
@interface ViewController () | |
@end | |
@implementation ViewController | |
-(void)go:(id)sender | |
{ | |
NSLog(@"GGGG"); | |
} | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 100, 30)]; | |
btn.frame = CGRectMake(100, 100, 100, 30); | |
btn.layer.masksToBounds = YES; | |
btn.layer.cornerRadius = 4; | |
[btn setTitle:@"获取" forState:UIControlStateNormal]; | |
[btn setBackgroundColor:[UIColor blueColor]]; | |
[btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; | |
[btn addTarget:self action:@selector(go:) forControlEvents:UIControlEventTouchUpOutside]; | |
[self.view addSubview:btn]; | |
// Do any additional setup after loading the view, typically from a nib. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment