Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要用两个动作制作一个按钮,touch down 用于播放声音,然后当您松开按钮时,touch up 内部停止播放声音
将两种方法连接到这两个操作。
[self.yourBtn addTarget:self action:@selector(touchDownMethod:) forControlEvents:UIControlEventTouchDown]; [self.yourBtn addTarget:self action:@selector(touchUpInsideMethod:) forControlEvents:UIControlEventTouchUpInside];