mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 09:12:06 +08:00
Cleanup native view hierarchy when view is dropped.
Differential Revision: D2659738 fb-gh-sync-id: 1c14b8c3c6fabbd0e580777bb94221df6dd98f71
This commit is contained in:
committed by
facebook-github-bot-7
parent
0f590d1233
commit
bd1885b5d4
@@ -393,12 +393,13 @@ import com.facebook.react.touch.JSResponderHandler;
|
||||
if (view instanceof ViewGroup && viewManager instanceof ViewGroupManager) {
|
||||
ViewGroup viewGroup = (ViewGroup) view;
|
||||
ViewGroupManager viewGroupManager = (ViewGroupManager) viewManager;
|
||||
for (int i = 0; i < viewGroupManager.getChildCount(viewGroup); i++) {
|
||||
for (int i = viewGroupManager.getChildCount(viewGroup) - 1; i >= 0; i--) {
|
||||
View child = viewGroupManager.getChildAt(viewGroup, i);
|
||||
if (mTagsToViews.get(child.getId()) != null) {
|
||||
dropView(child);
|
||||
}
|
||||
}
|
||||
viewGroupManager.removeAllViews(viewGroup);
|
||||
}
|
||||
mTagsToViews.remove(view.getId());
|
||||
mTagsToViewManagers.remove(view.getId());
|
||||
|
||||
Reference in New Issue
Block a user