1
我已經定製了UITableViewCell
,我有一個UILabel
和UIButton
。我已經在layoutSubviews
方法中設置了框架,該表格已經自定義了UITableViewCell
,我在三個地方使用了該方法,但我需要刪除第二位的UIButton
。怎麼做 ?如何從UITableViewCell中刪除按鈕?
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
CustomPopTableViewCell *cell = (CustomPopTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[CustomPopTableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
cell.accessoryType = UITableViewCellAccessoryNone;
if(tableView.tag == e_metadataView)
{
//cell.mCheakMarkButton.frame=CGRectZero;
cell.mTaggedTerm.text = [docInfoCollection objectAtIndex:indexPath.row];
}
else if(tableView.tag == e_searchSettingView)
{
if(indexPath.row == self.currentRow)
{
[cell.mcheckMarkButton removeFromSuperView];
}
cell.mTaggedTerm.text = [searchEngineCollection objectAtIndex:indexPath.row];
}
else if(tableView.tag == e_TaggedTermView)//tageed term table
{
TaggedItems *taggedItem = [documentData.taggedWords objectAtIndex : indexPath.row];
cell.mTaggedTerm.text = taggedItem.keyword;
if([self isTappedObjectExist:indexPath.row])
{
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
}
return cell;
}
它是removeFromSuperview,「v」很小:) –