简体   繁体   中英

View as first responder

大家好,我想知道如何将subView添加到单元格的内容视图中以使其成为firstResponder。当我触摸单元格时,调用tableViewDidSelectRow方法。我已经将customView作为subView添加到单元格中。我实现了委托方法,当自定义时,将调用该方法视图结束。但是此方法在调用tableViewDidSelectRow方法之后被调用。我想首先调用委托方法,然后再调用tableViewDidSelectRow。我什至将customView excluiveTouch属性设置为YES。

Definitely ,

  • (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

will called after DidSelectRowFor . Because didSelect called as we click the cell and touchesEnded after when we removing the finger.

if u want touchesEnded must called before DidSelectRowFor than you have to override the some method. like

  • (BOOL)becomeFirstResponder in cell class as well as in custom class properly. also override

  • (UIResponder *)nextResponder this method to call next responder.

try once this . and let me know whether working or not?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM