Note that there are some explanatory texts on larger screens.

plurals
  1. POAdd/remove image on button press
    primarykey
    data
    text
    <p>This my tableview.i want when user press button then another image should on the top of that image and removed when again user presses wt is the code</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { CGRect prescriptionFrame=CGRectMake(100, 0, 150, 40); UILabel *presTextLabel=[[UILabel alloc] initWithFrame:prescriptionFrame]; presTextLabel.font=[UIFont boldSystemFontOfSize:20]; CGRect tabletFrame=CGRectMake(150, 50, 100, 20); UILabel *tabletTextLabel=[[UILabel alloc] initWithFrame:tabletFrame]; tabletTextLabel.font=[UIFont boldSystemFontOfSize:10]; CGRect noOfTabletFrame=CGRectMake(250, 40, 30, 30); UILabel *noOfTabletTextLabel=[[UILabel alloc] initWithFrame:noOfTabletFrame]; noOfTabletTextLabel.font=[UIFont boldSystemFontOfSize:10]; cellButton = [UIButton buttonWithType:UIButtonTypeCustom]; cellButton.frame=CGRectMake(10,10 ,50,50); presTextLabel.text=[appDelegate.prescriptionArray objectAtIndex:indexPath.row]; tabletTextLabel.text=[appDelegate.tabletArray objectAtIndex:indexPath.row]; noOfTabletTextLabel.text=[appDelegate.noOfTabletsArray objectAtIndex:indexPath.row]; [cellButton setImage:[appDelegate.imageArray objectAtIndex:indexPath.row] forState:UIControlStateNormal]; [cellButton addTarget:self action:@selector(StartTimer) forControlEvents:UIControlEventTouchUpInside]; cellButton.tag = indexPath.row; [cell.contentView addSubview:presTextLabel]; [cell.contentView addSubview:tabletTextLabel]; [cell.contentView addSubview:noOfTabletTextLabel]; [cell.contentView addSubview:cellButton]; [presTextLabel release]; [tabletTextLabel release]; return cell; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload