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

iPad分屏模式选启动占位图大小异常 #252

Open
CoderMaurice opened this issue Jun 2, 2021 · 0 comments
Open

iPad分屏模式选启动占位图大小异常 #252

CoderMaurice opened this issue Jun 2, 2021 · 0 comments

Comments

@CoderMaurice
Copy link

检查后发现是因为XHLaunchImageView使用了[UIScreen mainScreen].bounds作为创建大小
而在分屏模式下 app大小和screen大小是不一致的

借用了QMUI的一段代码,修改后一切正常

+ (CGSize)applicationSize {
    /// applicationFrame 在 iPad 下返回的 size 要比 window 实际的 size 小,这个差值体现在 origin 上,所以用 origin + size 修正得到正确的大小。
    BeginIgnoreDeprecatedWarning
    CGRect applicationFrame = [UIScreen mainScreen].applicationFrame;
    EndIgnoreDeprecatedWarning
    return CGSizeMake(applicationFrame.size.width + applicationFrame.origin.x, applicationFrame.size.height + applicationFrame.origin.y);
}
@CoderMaurice CoderMaurice changed the title iPad分屏模式界面站位启动图大小异常 iPad分屏模式选启动占位图大小异常 Jun 2, 2021
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