I am developing an iPhone application where i need to show UIButtons with back images horizontally(each row two buttons with back images) with scrollbar provision in a View. I have a tabbar application created. Please refer the attached sample image. How can i develop such screen? Do i need create tableview with just ONE row, where i can add UIButtons with back images horizontally (or) How can i achieve it easily? Is there a sample program available?
Note: When clicking on button, i also need to know which button is clicked. I have actions for all buttons..
Please help!

UPDATED:
I’m able to achieve the buttons with images horizontally (in two button in a row). My problem is, how can i tag it properly, so that i can action it properly.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell=[[UITableViewCell alloc]init];
static NSString *CellIdentifier1 = @"Cell";
cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
// if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier1] autorelease];
//}
tableView.separatorStyle=UITableViewCellSeparatorStyleNone;
cell.backgroundColor = [UIColor clearColor];
UIButton *btn1 = [[UIButton alloc] initWithFrame:CGRectMake(11.0, 6.0, 80.0, 65.0)];
//UIImageView *imageView = [UIImage imageNamed:@"avatar.png"];
btn1.enabled = YES;
// btn1.tag = ?????; // HOW can it tag it properly.
[btn1 setBackgroundImage:[UIImage imageNamed:@"image1.png"] forState:UIControlStateNormal];
[btn1 addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:btn1];
UIButton *btn2 = [[UIButton alloc] initWithFrame:CGRectMake(180.0, 6.0, 80.0, 65.0)];
[btn2 addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
// btn2.tag = ?????; // HOW can it tag it properly as it is in horizontal position.
[btn2 setImage:[UIImage imageNamed:@"image2.png"] forState:UIControlStateNormal];
[cell.contentView addSubview:btn2];
}
-(IBAction) buttonPressed: (id) sender
{
UIButton *button = (UIButton *)sender;
NSLog(@"Btn Tag: %d", [sender tag]);
}
NOW you have to do on this way at least you will know how much will be the button the work will be easy . in my code i assume that i have 100 buttons so firstly don’t use the static indentifier in table view cells use the code like this way .
NSString *CellIdentifier = [NSString stringWithFormat:@”identifier_%d”, indexPath.row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
//if (cell == nil)
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
// now i assume the button are 100 so i assing the indexrow to first button and indexrow+100 tag to another button and code is like this way the button will be global or local depends upon you
and the function called by button on their clicking is as
UIButton *Button = (UIButton *)sender; NSLog(@”Selected button tag is %d”, Button.tag);
the tag which will print the value in 3 digit is a right hand button and other one is left handed but i assume only are 100 button are there so check out with your logic .
Thanks,