Skip to content

Instantly share code, notes, and snippets.

@erikfloresq
Last active March 4, 2016 22:03
Show Gist options
  • Save erikfloresq/2abe05a93c28d255b53c to your computer and use it in GitHub Desktop.
Save erikfloresq/2abe05a93c28d255b53c to your computer and use it in GitHub Desktop.
Create button with code
UIButton *btnStreetView = [UIButton buttonWithType:UIButtonTypeCustom];
btnStreetView.frame = CGRectMake( _viewMapa.frame.size.width - 130 , _viewMapa.frame.size.height - 40, 120, 30);
[btnStreetView setTitle:@"Ver StreetView" forState:UIControlStateNormal];
btnStreetView.titleLabel.font = [UIFont fontWithName:@"Helvetica" size:14.0f];
btnStreetView.layer.cornerRadius = 3;
[btnStreetView addTarget:self action:@selector(changeTypeMap) forControlEvents:UIControlEventTouchUpInside];
btnStreetView.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
btnStreetView.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
[btnStreetView setTitleColor:[UIColor colorWithRed:0.988 green:0.988 blue:0.988 alpha:1] forState:UIControlStateNormal];
btnStreetView.backgroundColor = [UIColor colorWithRed:0.980 green:0.412 blue:0.012 alpha:1];
[btnStreetView setContentEdgeInsets:UIEdgeInsetsMake(0.0, 0.0, 0.0, 0.0)];
[_viewMapa addSubview:btnStreetView];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment