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

轮播图全屏的时候,push到下个界面,会出现imageview重新计算大小导致大小不是全屏 #52

Open
carry1024 opened this issue May 23, 2023 · 0 comments

Comments

@carry1024
Copy link

轮播图全屏的时候,push到下个界面,会出现imageview重新计算大小导致大小不是全屏

lazy var carouselV: XRCarouselView = {
    let view = XRCarouselView()
    view.imageArray = [
        UIImage.Name("login_back1")!,
        UIImage.Name("login_back2")!,
        UIImage.Name("login_back3")!
    ]
    view.pagePosition = .PositionHide
    view.time = 5
    view.contentMode = .scaleAspectFill
    view.isUserInteractionEnabled = false
    return view
}()

view.addSubview(carouselV)
carouselV.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
这样,但是在我push到下个界面的时候,会在要进入下个界面的时候,imageview的大小会从状态栏下面开始,而不是全屏,导致状态栏显示出来,我看层级,只有imageview会这样,下面的scrollview并没有

<UIImageView: 0x10c9264d0; frame = (828 0; 414 896); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x28222e100>>
Printing description of $54:
<UIScrollView: 0x111044e00; frame = (0 0; 414 896); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x282ce1fb0>; layer = <CALayer: 0x28222dd60>; contentOffset: {828, -44}; contentSize: {2070, 0}; adjustedContentInset: {44, 0, 34, 0}>
Printing description of $55:
<XRCarouselView: 0x10c924e10; frame = (0 0; 414 896); userInteractionEnabled = NO; layer = <CALayer: 0x28222e4e0>>

这是我断点的时候打印出的属性,我看到是UIScrollView 的contentOffset: {828, 0} 变化了contentOffset: {828, -44}

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

1 participant