私のアプリには1つのUITableViewがあります。テーブルセルに2つのラベルと1つのボタンを配置しています。ボタンの高さは(label1 + label2)の高さと同じです。これらはコンテンツを表示するためのものです。ボタンはアクション用です。ここで私の問題は、すべての部分でボタンアクションを実行できないことです。クリックすると一部だけが機能します。
ラベルとボタンを配置するために使用されるコードは次のとおりです
artistButton = [[UIButton alloc] initWithFrame:CGRectMake(11.0, 6.0, 170.0, 50.0)];
artistButton.backgroundColor = [UIColor redColor];
[self.contentView bringSubviewToFront:artistButton];
[self.contentView addSubview:artistButton];
artistLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(11.0, 6.0, 170.0, 27.0)];
artistLabel1.textAlignment = UITextAlignmentLeft;
artistLabel1.textColor = [UIColor colorWithRed:0.14 green:0.29 blue:0.42 alpha:1];
artistLabel1.font = [UIFont boldSystemFontOfSize:15.0];
artistLabel1.backgroundColor = [UIColor blueColor];
[self.contentView addSubview:artistLabel1];
artistLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(11.0,20.0, 170.0, 27.0)];
artistLabel2.textAlignment = UITextAlignmentLeft;
artistLabel2.textColor = [UIColor grayColor];
artistLabel2.font = [UIFont boldSystemFontOfSize:12.0];
artistLabel2.backgroundColor = [UIColor grayColor];
[self.contentView addSubview:artistLabel2];
誰でも助けたり提案したりできます。前もって感謝します。