UIButton * button2 = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage * image = [UIImage imageNamed:@"1.png"];
UIImage * bgImage = [UIImage imageNamed:@"map.png"];
[button2 setImage:image forState:UIControlStateNormal];
[button2 setBackgroundImage:bgImage forState:UIControlStateNormal];
button2.frame = CGRectMake(0, 80, 375, 30);
button2.showsTouchWhenHighlighted = YES;
[self.view addSubview:button2];
UIButton * button3 = [UIButton buttonWithType:UIButtonTypeCustom];
button3.frame = CGRectMake(0, 120, 375, 30);
[button3 setTitle:@"按钮" forState:UIControlStateNormal];
[button3 setTitle:@"llalala" forState:UIControlStateHighlighted];
[button3 setBackgroundColor:[UIColor grayColor]];
[button3 setTitleColor:[UIColor yellowColor] forState:UIControlStateNormal];
button3.enabled = YES;
button3.tag = 101;
[button3 addTarget:self action:@selector(onClick:)forControlEvents:UIControlEventTouchUpInside];
button3.layer.cornerRadius = 10;
button3.layer.borderColor = [UIColor grayColor].CGColor;
button3.layer.borderWidth = 3;
button3.titleLabel.font = [UIFont fontWithName:@"Menlo" size:30];
button3.titleLabel.backgroundColor = [UIColor redColor];
button.imageEdgeInsets = UIEdgeInsetsMake(10, 20, 10, 40);
button.contentEdgeInsets = UIEdgeInsetsMake(30, 10, 0, 0);
button.titleEdgeInsetsEdgeInsets = UIEdgeInsetsMake(30, 10, 0, 0);
[self.view addSubview:button3];