How to highlight a row in a UITableView

前端 未结 6 1135
名媛妹妹
名媛妹妹 2020-12-31 10:00

The code below seems to have no effect. I want it to be highlighed in the same way it highlights when you tap on a row

- (UITableViewCell *)tableView:(UITab         


        
6条回答
  •  渐次进展
    2020-12-31 10:53

    - (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(NSIndexPath *)indexPath {
       return YES;
    }
    
    - (void)tableView:(UITableView *)tableView didHighlightRowAtIndexPath:(NSIndexPath *)indexPath {
      // do something here
    }
    

    Try this :)

提交回复
热议问题