I have created one application in which if i select on particular row in Table View than that selected row will expand(I have implemented row onclick row expand perfectly but i have problem with [cell.contentview addsubview:] please see image i have provided) & there is some button but i can’t get perfect view in table view without clicking row i can see other cell’s button here is image!
my code for displaying button is here.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
cell = [tableBusiness dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
//cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
//cell.textLabel.borderStyle = UITextBorderStyleNone;
cell.textLabel.text = [NSString stringWithFormat:@"%d",indexPath.row];
UILabel *theText = [[UILabel alloc] initWithFrame:CGRectMake(10.0,10.0, 200, 22.0)];
theText.text = [NSString stringWithFormat:@" Title Text %d",indexPath.row];
[cell.contentView addSubview:theText];
btnMenu = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btnMenu.frame = CGRectMake(80, 160, 100, 37);
[btnMenu setTitle:@"Go to Menu" forState:UIControlStateNormal];
[btnMenu addTarget:nil action:@selector(accessoryTypeForRowWithIndexPath:) forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:btnMenu];
//textView.text = nil;
return cell;
[btnMenu release];
[theText release];
}
& i want to make button events like on clicking particular button open that clicked button product how to do that?
does any have solutions please help me.
i want to create like this !Here is description for the image thread.
If you want to increase the height of cell then u can try with following code
But remember that you delegate your tableview.