Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

[iOS] sdk 0.28.0 版本的项目在iOS 14 beta系统中运行,图片无法显示 #3265

Open
lz156 opened this issue Sep 4, 2020 · 11 comments
Labels

Comments

@lz156
Copy link

lz156 commented Sep 4, 2020

sdk 0.28.0 版本的项目在iOS 14 beta系统中运行,图片无法加载出来。

@lz156 lz156 added the Bug label Sep 4, 2020
@imatrixme
Copy link

imatrixme commented Sep 10, 2020

same problem, and if the app compiled by xcode 12 beta, all images will not show.

@yecoco
Copy link

yecoco commented Sep 17, 2020

一样,今天刚升级就出现这种问题

@dudwchina
Copy link

dudwchina commented Sep 18, 2020

Xcode Version 12.0 (12A7209) 今天升级的release版本,图片也是出不来。

经过测试发现Xcode11和12在给imageview.image赋值时layer.contents表现不同。

WXImageComponent.m

  • (void)updateContentImageWithFailedBlock:(void(^)(NSString *, NSError *))downloadFailedBlock方法中

Xcode11
layer.contents值不为空
image

Xcode12
layer.contents值为空
image

((UIImageView *)strongSelf.view).image = image; 修改为strongSelf.view.layer.contents = (__bridge id _Nullable)(image.CGImage);图片即可显示

详细原因探索中。。。

@wxh6520
Copy link

wxh6520 commented Sep 21, 2020

sdk 0.28.0 版本的项目用Xcode Version 12.0编译,在iOS 14 正式版系统中运行,图片无法加载出来。

@JianYeee
Copy link

JianYeee commented Sep 22, 2020

原因可能是在iOS14中,如果自定义了imageView的layer渲染,需要手动设置layer.contents,不会在设置了image后进行同步contents

image

在weex中,imageView组件除非设置了compositing,才进入layer层并重新渲染,否则仍旧以image为主

image

我的临时方案是设置image后主动同步layer.contents

image

if (image) { self.layer.contents = (id)image.CGImage; } else { self.layer.contents = nil; }

@xztl
Copy link

xztl commented Sep 24, 2020

原因可能是在iOS14中,如果自定义了imageView的layer渲染,需要手动设置layer.contents,不会在设置了image后进行同步contents

image

在weex中,imageView组件除非设置了compositing,才进入layer层并重新渲染,否则仍旧以image为主

image

我的临时方案是设置image后主动同步layer.contents

image

if (image) { self.layer.contents = (id)image.CGImage; } else { self.layer.contents = nil; }

测试iOS12.4.8 会出现部分加载不显示

@Su1001
Copy link

Su1001 commented Sep 25, 2020

针对iOS14系统,即Xcode12运行后,图片不显示,我是这样解决的 但是不太知道会不会有其他影响。
ACFD29AA-7B03-4FA4-9012-F6D155278B6B

WXLayer.m文件

  • (void)display
    {
    if (@available(iOS 14.0, *)) {
    [super display];
    }

    [self.wx_component _willDisplayLayer:self];
    }

@jianhan-he
Copy link
Contributor

#3276

this pr has already resolve this issue.

@y500
Copy link

y500 commented Sep 29, 2020

mark

@jianhan-he
Copy link
Contributor

最近我们release一个新版本,这个问题你们可以暂时先使用源码依赖去解决

@foermo4-hao
Copy link

原因可能是在iOS14中,如果自定义了imageView的layer渲染,需要手动设置layer.contents,不会在设置了image后进行同步contents

image

在weex中,imageView组件除非设置了compositing,才进入layer层并重新渲染,否则仍旧以image为主

image

我的临时方案是设置image后主动同步layer.contents

image

if (image) { self.layer.contents = (id)image.CGImage; } else { self.layer.contents = nil; }

Xcode 12.2 上可以了,谢谢

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests