Skip to content

Instantly share code, notes, and snippets.

@piaoapiao
Created November 19, 2012 15:05
Show Gist options
  • Save piaoapiao/4111158 to your computer and use it in GitHub Desktop.
Save piaoapiao/4111158 to your computer and use it in GitHub Desktop.
uibutton
#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