dorentus edited a comment on pull request #3268:
URL: https://github.com/apache/incubator-weex/pull/3268#issuecomment-751980221


   我这边使用 https://github.com/apache/incubator-weex/pull/3276 
之后还是会遇到图片不显示的问题,不是所有图片,随机有部分图片显示不出来,每次不同。调试显示对应的 `WXImageView` 的 `image` 
属性都有值,但是没有显示出来。
   
   现在我用了这样的方式绕过:
   
   ```diff
   diff --git a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m 
b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
   index 
628033fbe541cf4b9506d4279ad99615e0d616fc..2f02c2580aafd66f81a2cf3001d1e09dc1fe0838
 100644
   --- a/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
   +++ b/ios/sdk/WeexSDK/Sources/Component/WXImageComponent.m
   @@ -35,6 +35,26 @@
    #import <pthread/pthread.h>
    #import "WXMonitor.h"
    #import "WXSDKInstance_performance.h"
   +#import <objc/message.h>
   +
   +@interface WXImageLayer : WXLayer
   +
   +@end
   +
   +@implementation WXImageLayer
   +
   +- (void)display
   +{
   +    if (@available(iOS 14.0, *)) {
   +        // call -[CALayer display]
   +        struct objc_super s = {.receiver = self, .super_class = 
self.superclass.superclass};
   +        ((void (*)(struct objc_super *, SEL))objc_msgSendSuper)(&s, _cmd);
   +    }
   +
   +    [super display];
   +}
   +
   +@end
    
    @interface WXImageView : UIImageView
    
   @@ -44,7 +64,7 @@
    
    + (Class)layerClass
    {
   -    return [WXLayer class];
   +    return [WXImageLayer class];
    }
    
    @end
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to