Reputation: 95
I can not figure out how to construct this button. I need help in the creation of this, note that the strip is not painted when the button is active. What elements should I use?
on link you can look this button
https://i.sstatic.net/0mmJ0.png
UIButton *clone = [[UIButton alloc] initWithFrame:frame];
[clone setTitle:strDate forState:UIControlStateNormal];
[clone setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted];
clone.frame = CGRectMake(19, post_offer_top*(i-1)+22, 281, 75);
clone.tag = my_id;
// [clone setTitle:[[buttons objectAtIndex:i-1] objectForKey:@"title"] forState:UIControlStateNormal];
clone.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
clone.contentEdgeInsets = UIEdgeInsetsMake(44, 31, 0, 0);
[clone setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[clone setTitleShadowColor:[UIColor whiteColor] forState:UIControlStateNormal];
[clone.titleLabel setFont:[UIFont fontWithName:@"PF DinDisplay Pro" size:10]];
[clone.titleLabel setShadowOffset:CGSizeMake(0.0f, 1.0f)];
any ideas?
Upvotes: 2
Views: 499
Reputation: 3545
You should initialize buttons like this [UIButton buttonWithType:UIButtonTypeCustom]
Upvotes: 1