YBImageBrowser,iPad分屏解决方案

1:YBImageBrowser.m文件第37行加入

- (void)layoutSubviews {
    [super layoutSubviews];
    self.bounds = [UIApplication sharedApplication].keyWindow.bounds;
    self.collectionView.frame = self.bounds;
    self.containerView.frame = self.bounds;
    for (id<YBIBToolViewHandler> handler in self.toolViewHandlers) {
        [handler yb_containerViewIsLayoutSubviews];
    }
}

2:在YBIBImageCell.m文件第37行加入

- (void)layoutSubviews {
    [super layoutSubviews];
    self.imageScrollView.frame = self.bounds;
    CGSize size = self.imageScrollView.imageView.image.size;
    [self updateImageLayoutWithOrientation:self.yb_currentOrientation() previousImageSize:size];
}

在113行加入

containerSize = self.bounds.size;

3:在YBIBToolViewHandler.h加入方法

/**
 LayoutSubviews
 */
- (void)yb_containerViewIsLayoutSubviews;

在YBIBToolViewHandler.m加入方法

- (void)yb_containerViewIsLayoutSubviews {
    [self layoutWithExpectOrientation:self.yb_currentOrientation()];
}

在第74行加入代码

containerSize = [UIApplication sharedApplication].keyWindow.bounds.size;
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。