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];
}