mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-26 23:05:00 +08:00
Add support for delete animation in LayoutAnimation on iOS
Summary:This adds support for delete view animations in LayoutAnimation for iOS. It supports the same properties as the create animation (alpha, scale). This allows making simple animations when removing a view which is normally hard to do in React since we need to not remove the view node immediately. **Test plan** Tested add/removing views in the UIExample explorer with and without setting a LayoutAnimation. Also tested that the completion callback still works properly. Tested that user interation during the animation is properly disabled.  I also plan to work on improving the doc for LayoutAnimation as well as making this PR for android too. Closes https://github.com/facebook/react-native/pull/6779 Differential Revision: D3215525 Pulled By: sahrens fb-gh-sync-id: 526120acd371c8d1af433e8f199cfed336183775 fbshipit-source-id: 526120acd371c8d1af433e8f199cfed336183775
This commit is contained in:
committed by
Facebook Github Bot 7
parent
23918692ac
commit
baa3668160
@@ -86,6 +86,10 @@ function create(duration: number, type, creationProp): Config {
|
||||
update: {
|
||||
type,
|
||||
},
|
||||
delete: {
|
||||
type,
|
||||
property: creationProp,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -106,6 +110,10 @@ var Presets = {
|
||||
type: Types.spring,
|
||||
springDamping: 0.4,
|
||||
},
|
||||
delete: {
|
||||
type: Types.linear,
|
||||
property: Properties.opacity,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user