Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

图片加载有问题 #53

Closed
JianWenXie opened this issue Nov 15, 2021 · 11 comments
Closed

图片加载有问题 #53

JianWenXie opened this issue Nov 15, 2021 · 11 comments

Comments

@JianWenXie
Copy link

bundle中的图片,如果pod引入工程 ,图标显示不出来

@LuKane
Copy link
Owner

LuKane commented Nov 15, 2021

能具体说一下... 哪些图标不显示? 以及 在什么设备上测试的!! 我这边好对应修改!

@LuKane
Copy link
Owner

LuKane commented Nov 17, 2021

我这边试了一下 cocoapods. bundle中的资源文件可以显示的!

@LuKane LuKane closed this as completed Nov 17, 2021
@hstdt
Copy link
Contributor

hstdt commented Dec 29, 2021

@LuKane 确实有图标显示不出来,pod导入的,视频按钮出不来

@LuKane
Copy link
Owner

LuKane commented Dec 29, 2021

1.麻烦说一下 设备型号 以及 系统版本号!
2.模拟器上能复现吗?

@LuKane LuKane reopened this Dec 29, 2021
@hstdt
Copy link
Contributor

hstdt commented Dec 29, 2021

1.麻烦说一下 设备型号 以及 系统版本号! 2.模拟器上能复现吗?

iPhone 8(iOS 13), iPhone XS Max(iOS 15) 和模拟器(iPad Pro 11 寸 IOS 15.2)均能复现

使用的是master分支代码

@LuKane
Copy link
Owner

LuKane commented Dec 29, 2021

方便的话. 加一下QQ细说!! 1169604556

@hstdt
Copy link
Contributor

hstdt commented Dec 29, 2021

@LuKane 加载图片的代码增加一个in bundle就可以了

NSBundle *bundle = [NSBundle bundleForClass:[KNPhotoBrowser class]];

比如

- (void)setIsPlaying:(BOOL)isPlaying{
    _isPlaying = isPlaying;
    if (isPlaying) {
        _isDragging = false;
        [_slider setUserInteractionEnabled:true];

        [_pauseStopBtn setImage:[UIImage imageNamed:@"KNPhotoBrowser.bundle/pause@2x.png" inBundle:bundle compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
    }else{
        [_pauseStopBtn setImage:[UIImage imageNamed:@"KNPhotoBrowser.bundle/play@2x.png" inBundle:bundle compatibleWithTraitCollection:nil] forState:UIControlStateNormal];
    }
}

另外使用asset就能更方便切换 1x 2x 3x 图

https://stackoverflow.com/a/61119321/4728060

@LuKane
Copy link
Owner

LuKane commented Dec 29, 2021

好的好的!! 我先找出部分机型显示不出来的原因

@LuKane LuKane closed this as completed Dec 29, 2021
@hstdt
Copy link
Contributor

hstdt commented Dec 30, 2021

好的好的!! 我先找出部分机型显示不出来的原因

@LuKane 就像上面说的,原因就是没加inBundle,加上就好了,我确认过了。

@LuKane
Copy link
Owner

LuKane commented Dec 30, 2021

好的

@LuKane
Copy link
Owner

LuKane commented Jan 4, 2022

cocoapods中的 2.5.5版本已修复!

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

No branches or pull requests

3 participants