UITableViewで4x4メトリックのボタンを作成しました。 ボタンを順番に選択したいと思います。UITableViewで順番にボタンのアクションをクリックします。
ビューコントローラにおける行インデックス
for (int i = 0; i< [buttonArray count]; i++)
{
int buttonSpace = 10 * i + 10;
NSLog(@"ButtonPosition:%d",buttonSpace + (i * 50));
cell.Button = [[CustomButton alloc] initWithFrame:CGRectMake(buttonSpace + (i * 50),35, 50, 50)];
cell.Button.layer.cornerRadius = 25;
[cell.Button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
cell.Button.buttonIndex = i;
[cell.ScrollView addSubview:cell.Button];
cell.ScrollView.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.3];
}
rowIndexValue = indexPath.row;
//ボタンアクションのセルにおける//ボタン作成。
-(void)buttonAction:(CustomButton *)sender
{
if (rowIndexValue) {
int counter = (int)[sender buttonIndex];
if (counter == incrementValue)
{
sender.backgroundColor = [UIColor redColor];
counter += 1;
incrementValue = counter;
}
else{
sender.selected = NO;
}
}
}
任意の行のボタン操作の順番です。 ユーザー選択3行目ですが、3行目の選択行は1番目のボタンから、2番目のボタンから3番目のボタン、4番目のボタンまでです。
各行のUITableview 4ボタンの4x4 - > 4行。ボタンをクリックすると無効モードになります
問題は何ですか? – Lion
@LionランダムなUITableView行でボタンを順番に選択したいのですが。各行に4×4 4行の使用可能なビュー4ボタン。ボタンをクリックすると、無効モードになります。 – kiran
'ボタンが順番に任意のUITableView行にあります'この行はどういう意味ですか? – Lion