2012-03-16 14 views

回答

0

用1px創建一個UIView作爲width和gray作爲backgroundColor,並將這添加到複選標記的右側應該沒問題。

0

如果你編輯選項是一個圖像,那麼你可以做下面的代碼來顯示一行。

步驟

1]首先進口QuartzCore/QuartzCore.h

2]設置邊框的寬度和你的編輯圖像的邊框顏色屬性。

[editImageView.layer setBorderWidth:2.0]; 

[editImageView.layer setBorderColor:[[UIColor grayColor] CGColor]]; 

//If you putting a button for edit then also you can set the same. Just replace the editImageView with your editButton 

希望你得到確切你想要:)

5

看看這個!

申報BOOL對號;在.h 檢查其值。

// This all code in Cell For Row At IndexPath : 

for (UIView *ObView in [cell.contentView subviews]) 

{ 

    [ObView removeFromSuperview]; 
} 

if(checkMark == YES) // you can check here by imdexPath.row. 

{ 
    UILabel *lbl = [[UILabel alloc]initWithFrame:CGRectMake(10,5,150,30)]; 
    lbl.text = @""; 
    [cell.contentView addSubview:lbl]; 

    UIImageView *CheckImage = [[UIImageView alloc]initWithFrame:CGRectMake(160,5,20,20)]; 
    CheckImage.image = [UIImage imageNamed:@""]; 
    [cell.contentView addSubview:CheckImage]; 

    UIImageView *BarImage = [[UIImageView alloc]initWithFrame:CGRectMake(185,5,0.5,30)]; 
    BarImage.image = [UIImage imageNamed:@""]; 
    [cell.contentView addSubview:BarImage]; 

    UIImageView *tblImage = [[UIImageView alloc]initWithFrame:CGRectMake(160,5,20,20)]; 
    tblImage.image = [UIImage imageNamed:@""]; 
    [cell.contentView addSubview:tblImage]; 
} 
else 
{ 
    UILabel *lbl = [[UILabel alloc]initWithFrame:CGRectMake(10,5,150,30)]; 
    lbl.text = @""; 
    [cell.contentView addSubview:lbl]; 

    UIImageView *tblImage = [[UIImageView alloc]initWithFrame:CGRectMake(160,5,20,20)]; 
    tblImage.image = [UIImage imageNamed:@""]; 
    [cell.contentView addSubview:tblImage]; 
} 

注意:幀是臨時的。

1

因此,你基本上有一個tableView,你想添加該圖像「|」在你編輯時你的tableViewCell

我會假設你已經有editingEnabled您的tableView,你將需要實現

- (void)setEditing:(BOOL)editing animated:(BOOL)animate 

    { 

    if (editing) { 
      // Configure self.tableView and individual cells and add the "|" as a subView. 
      // It will all be tricky, and you should be able to logically place the vertical bar 
      // But whatever you want to be in your EDIT mode, you will have to configure it here. 
    } else { 
      // Re-configure and implement the 'correct' cells back to normal tableView 
    } 

} 
0

採取的UIImageView表格單元格,並根據您的tablename.cell.height其寬度設置爲1,設置高度。

它肯定會解決你的問題

0

你可以定製你的tableview cell.Just在細胞創建時添加子視圖,換上編輯按鈕,它隱藏起來,直到點擊。

相關問題