請參閱以下附件圖像。我想從 UITableViewCell
中刪除白色。如何從桌面單元中刪除白色。? 如何從UITable中刪除白色查看單元格
這裏是我的代碼:
-(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*[email protected]"";
if(sch.ptime.length<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*[email protected]"";
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;
}
你在談論的白線? – Rushi 2013-03-06 09:24:17
@Rushi nope,白色塊 – 2013-03-06 09:27:17