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”很小:) –