Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-11586] Ensure sublayers indices follow subview indices #3357

Merged
merged 1 commit into from
Nov 16, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions iphone/Classes/TiViewProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -2117,8 +2117,17 @@ -(void)insertSubview:(UIView *)childView forProxy:(TiViewProxy *)childProxy
}
}
pthread_rwlock_unlock(&childrenLock);

[ourView insertSubview:childView atIndex:result];
if (result == 0) {
[ourView insertSubview:childView atIndex:result];
}
else {
//Doing a blind insert at index messes up the underlying sublayer indices
//if there are layers which do not belong to subviews (backgroundGradient)
//So ensure the subview layer goes at the right index
//See TIMOB-11586 for fail case
UIView *sibling = [[ourView subviews] objectAtIndex:result-1];
[ourView insertSubview:childView aboveSubview:sibling];
}
}


Expand Down