You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by gu...@apache.org on 2017/11/09 09:50:51 UTC
[1/2] incubator-weex git commit: [WEEX-98][iOS]bug-fix addEvent lead
to generate a new view while it has been recycled
Repository: incubator-weex
Updated Branches:
refs/heads/master 895bc9fb4 -> 970c36bab
[WEEX-98][iOS]bug-fix addEvent lead to generate a new view while it has been recycled
In most case , element in cell will be re-use for memory especially in very
long list, but if add event for this element, here will generate a new view for
this element,if it's nil due to a getter method whether it is off-screen.
For instance, image element in cell will re-use if it is disappear in vision area,
loaded again while it back to visual area. In this case , when it disappear, just
add event such as click, touch and so on , it will then create a new view,
and load image again, although it is off-screen.
If the view is not loaded, so won't add gesture or call this view getter to create
any view until the view is loaded, then it will init events according to record in
component.
Bug: 98
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/62677d7c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/62677d7c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/62677d7c
Branch: refs/heads/master
Commit: 62677d7cffd2c94abfd4d82e5b3797f65872f91e
Parents: 30716b6
Author: acton393 <zh...@gmail.com>
Authored: Wed Nov 8 01:18:26 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Wed Nov 8 01:18:26 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/62677d7c/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
index 2c343f4..5747fe4 100644
--- a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
+++ b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
@@ -154,6 +154,11 @@ if ([removeEventName isEqualToString:@#eventName]) {\
- (void)_addEventOnMainThread:(NSString *)addEventName
{
+ if (![self isViewLoaded]) {
+ //This action will be ignored While the view is loaded,
+ //then it will initEvent according to the records in _events
+ return;
+ }
WX_ADD_EVENT(appear, addAppearEvent)
WX_ADD_EVENT(disappear, addDisappearEvent)
[2/2] incubator-weex git commit: * [ios] bug-fix addEvent lead to
generate a new view while it as been recycled
Posted by gu...@apache.org.
* [ios] bug-fix addEvent lead to generate a new view while it as been recycled
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/970c36ba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/970c36ba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/970c36ba
Branch: refs/heads/master
Commit: 970c36bab334832edf01991eb659fa9cf8b6ca73
Parents: 895bc9f 62677d7
Author: gurisxie <27...@qq.com>
Authored: Thu Nov 9 17:50:11 2017 +0800
Committer: gurisxie <27...@qq.com>
Committed: Thu Nov 9 17:50:43 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------