Я создал такую кнопку:
UIButton *meerKnop = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[[meerKnop layer] setCornerRadius:10.0f];
meerKnop.backgroundColor = [UIColor whiteColor];
meerKnop.frame = CGRectMake(11.0, (60.0 + (teller * 52.5)), 299.0, 50.0);
UILabel *locationLabel = [[UILabel alloc] initWithFrame:CGRectMake(17.5, 3.0, 128.0, 20.0)];
[locationLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:14]];
locationLabel.minimumFontSize = 12;
locationLabel.textColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.27 alpha:1.0];
locationLabel.lineBreakMode = UILineBreakModeTailTruncation;
[locationLabel setText:[[NSMutableString alloc] initWithFormat:@"%@", [incLocations objectAtIndex:teller]]];
[meerKnop addSubview:locationLabel];
UILabel *categoryLabel = [[UILabel alloc] initWithFrame:CGRectMake(17.5, 24.0, 256.0, 20.0)];
categoryLabel.lineBreakMode = UILineBreakModeTailTruncation;
[categoryLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:14]];
categoryLabel.minimumFontSize = 12;
categoryLabel.textColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.27 alpha:1.0];
[categoryLabel setText:[[NSMutableString alloc] initWithFormat:@"%@", [incInfos objectAtIndex:teller]]];
[meerKnop addSubview:categoryLabel];
UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)];
swipe.direction = UISwipeGestureRecognizerDirectionRight;
[meerKnop addGestureRecognizer:swipe];
[swipe release];
int incId = (int)[incIds objectAtIndex:teller];
[meerKnop addTarget:self action:@selector(alertPressed:) forControlEvents:UIControlEventTouchUpInside];
meerKnop.tag = incId;
[[meerKnop layer] setMasksToBounds:YES];
[meerKnop setShowsTouchWhenHighlighted:NO];
[cell addSubview:meerKnop];
Итак, мой заголовок делает вопрос очевидным.Когда я касаюсь и удерживаю созданную кнопку в iPhone, она все еще подсвечивается синим цветом.Основная проблема в том, что две вставленные метки не подсвечиваются.Как отключить подсветку (обратите внимание, что я уже вставил
[meerKnop setShowsTouchWhenHighlighted:NO];
, но это не работает), или как я могу позволить двум меткам подсвечиваться кнопкой?