Skip to content

Instantly share code, notes, and snippets.

@Mil0R
Mil0R / button.m
Created December 28, 2013 02:19
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = aFrame;// a rect can contain your image and your text label
UIImage *image = [UIImage imageNamed:@"image"];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:iFrame];// image frame on left of button
imageView.image = randomImage;
imageView.backgroundColor = [UIColor clearColor];
[button addSubview:imageView];
UILabel *label = [[UILabel alloc] initWithFrame:lFrame];//text frame on right of button