Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to remove white color from UITable View cell
    text
    copied!<p>See the following attachment image.I want to remove white color from <code>UITableViewCell</code>. How to remove white color from tableview cell.? <img src="https://i.stack.imgur.com/wckrS.png" alt="enter image description here"></p> <p>Here is my code:</p> <pre><code>-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; cell=nil; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } Schedule *sch=(Schedule*)[tableDataList objectAtIndex:indexPath.row]; NSString*ptime=@""; if(sch.ptime.length&lt;8){ ptime=[ptime stringByAppendingString:@" "]; ptime=[ptime stringByAppendingString:sch.ptime]; } else { ptime=[ptime stringByAppendingString:sch.ptime]; } UILabel *lbPTime=[[UILabel alloc]initWithFrame:CGRectMake(5, 10, 80, 25)]; lbPTime.font=[UIFont fontWithName:@"Zawgyi-One" size:15]; lbPTime.textColor=[UIColor whiteColor]; [lbPTime setText:ptime]; NSString*pname=@""; pname=[pname stringByAppendingString:sch.pname]; pname=[pname stringByAppendingString:@" "]; UILabel *lbPName=[[UILabel alloc]initWithFrame:CGRectMake(lbPTime.frame.size.width, 10, 250, 25)]; lbPName.font=[UIFont fontWithName:@"Zawgyi-One" size:15]; CGSize maximumLabelSize=CGSizeMake(296, 9999); CGSize expectedLabelSize= [pname sizeWithFont:lbPName.font constrainedToSize:maximumLabelSize lineBreakMode:lbPName.lineBreakMode]; CGRect newFrame=lbPName.frame; newFrame.size.height=expectedLabelSize.height; newFrame.size.width=expectedLabelSize.width; lbPName.frame=newFrame; lbPName.numberOfLines=0; lbPName.lineBreakMode=UILineBreakModeWordWrap; lbPName.textColor=[UIColor whiteColor]; [lbPName setText:pname]; [cell.contentView addSubview:lbPTime]; [cell.contentView addSubview:lbPName]; [cell.contentView sizeToFit]; UIView *v = [[UIView alloc]init]; v.backgroundColor = self.tableview.backgroundColor;//[UIColor clearColor]; cell.selectedBackgroundView = v; cell.backgroundColor=[UIColor clearColor]; return cell; } </code></pre>
 

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