This is an automated email from the ASF dual-hosted git repository.
moshen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git
The following commit(s) were added to refs/heads/master by this push:
new 3a8d561 [iOS] fix image can not show on XCode 12
new e8fcb95 Merge pull request #3276 from jianhan-he/master
3a8d561 is described below
commit 3a8d561076197e452d84d21a965858868daa3ebe
Author: linghe.lh <[email protected]>
AuthorDate: Fri Sep 25 16:12:35 2020 +0800
[iOS] fix image can not show on XCode 12
---
ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
index 9866523..b117791 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
@@ -308,6 +308,15 @@ WX_EXPORT_METHOD(@selector(save:))
[self updateImage];
}
+- (void)didFinishDrawingLayer:(BOOL)success {
+ if ([self isViewLoaded]) {
+ UIImage *image = ((UIImageView *)self.view).image;
+ if (image && !_layer.contents) {
+ _layer.contents = (id)(image.CGImage);
+ }
+ }
+}
+
- (void)schemeDidChange:(NSString*)scheme
{
[super schemeDidChange:scheme];