0
我有一个UIViews网格,每个都有一个触摸事件附加。当一个UIView被触动时,我想淡化所有的兄弟姐妹。动画同胞视图
有没有人有任何方向给这个?可以通过被触摸的UIView处理衰落的兄弟姐妹,或者视图控制器是否应该淡化兄弟姐妹?
编辑:想通了:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
for (UIView *subview in [self.superview subviews]) {
if (subview != self) {
subview.layer.opacity = 0.5;
}
}
[super bringSubviewToFront:self];
}