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.
以下函数应用于一组 UIView。而不是在完成触摸后改变颜色,我希望它只在用户在视图内部触摸时才改变颜色。因此,用户仍然可以将他们的手指拖到视图之外,因此该方法不会触发。
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { self.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"o_tile.png"]]; }