gpt4 book ai didi

ios [[自拍] 中心].x

转载 作者:行者123 更新时间:2023-12-01 17:27:07 25 4
gpt4 key购买 nike

在 ipad 上,当处于纵向时(不确定你是否称它为这个),[[self view] center].x 值位于中心 - 但在横向(躺下)时,它不是中心值。

有什么想法吗?

谢谢

最佳答案

center View 的属性是相对于它的superview ,这可能是 UIWindow在你的情况下。由于旋转由 View Controller 处理并且窗口实际上不旋转,center你的观点保持不变。

相反,您可能想要的是 View 边界的中心:

CGRect bounds = self.view.bounds;
CGPoint centerOfView = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));

关于ios [[自拍] 中心].x,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11235431/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com