gpt4 book ai didi

ios - 为什么主事件框架宽度大于高度,即使它处于纵向模式?

转载 作者:行者123 更新时间:2023-11-29 03:21:55 25 4
gpt4 key购买 nike

为什么当我测试我的应用程序时,IOS模拟器以纵向模式启动,所以在viewDidLoad函数self.view.frame.size.width等于1024但是单击按钮调用的内部函数是 768?我没有改变设备方向。我还粘贴了第一个和第二个函数中 self.view 的以下描述。

之前

Printing description of self->_view:
<UIView: 0x8b20720; frame = (0 0; 1024 748);
autoresize = RM+BM; layer = <CALayer: 0x8b291c0>>

之后

<UIView: 0x8b1da70; frame = (0 0; 768 1024); transform = [0, -1, 1, 0, 0, 0]; 
autoresize = RM+BM; layer = <CALayer: 0x8b20810>>

最佳答案

来自UIView docs :

frame

Warning: If the transform property is not the identity transform, the value of this property is undefined and therefore should be ignored.

改为使用 bounds 属性。

关于ios - 为什么主事件框架宽度大于高度,即使它处于纵向模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20972507/

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