【问题标题】:UIButton also highlighting when cell is touchedUIButton 在单元格被触摸时也会突出显示
【发布时间】:2010-05-04 22:07:59
【问题描述】:

我的表格单元格上有一个UIButton,它会弹出 (touchUpInside) 一个 UIAlertView 并询问用户是否要删除与该单元格关联的文件。否则,触摸单元格本身会突出显示单元格,然后移动到下一个级别以显示内容。问题是当单元格为selectedhighlighted 时,按钮也会突出显示,从而使用户感到困惑。

我怎样才能告诉按钮忽略对单元格的触摸或告诉单元格不理会该死的按钮。

【问题讨论】:

标签: iphone uitableview uibutton


【解决方案1】:

我尝试了这种解决方法,结果好坏参半。虽然它会将button 恢复到其normal 状态,但在从正常变为selected 并再次恢复正常时会出现短暂的闪烁。

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    CustomCell *cell = (CustomCell *)[tableView cellForRowAtIndexPath:indexPath];
    cell.button.highlighted = NO;
}

【讨论】:

    猜你喜欢
    • 2014-02-03
    • 1970-01-01
    • 1970-01-01
    • 2012-12-14
    • 2014-09-10
    • 1970-01-01
    • 1970-01-01
    • 2013-02-24
    • 2011-05-01
    相关资源
    最近更新 更多