iOS - Delayed “Touch Down” event for UIButton in UITableViewCell

前端 未结 7 1168
傲寒
傲寒 2020-12-01 00:10

I have a custom UITableViewCell, which is initialized by the following:

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIden         


        
相关标签:
7条回答
  • 2020-12-01 00:52

    Swift:

    Firstly, turn off delays in UITableView after it is loaded successfully, for example, inside viewDidLoad() method:

    someTableView.delaysContentTouches = false
    

    Then turn off delays in the scroll views contained inside the UITableView:

    for case let scrollView as UIScrollView in someTableView.subviews {
        scrollView.delaysContentTouches = false
    }
    

    Note for iOS7: You might have to disable the delays in UITableViewCell. (Check Dima's answer). You might also find some other tips here.

    0 讨论(0)
提交回复
热议问题