使用 PayPal lib 时的 iPhone 方向错误
我在我的 iPhone 应用程序中使用 Paypal 库。除了一件小事,方向之外,我的测试帐户一切正常。
我的应用程序是横向的,而 PayPal 库生成的屏幕是纵向的,当我从 PayPal 屏幕移回我的应用程序时,视图仍然全部是横向的,但状态栏移动到纵向,从而在状态栏通常的位置留下一个空间坐下并用状态栏切断视图的左侧。
我没有做任何奇怪的代码,只是下面显示的正常方向方法。任何建议表示赞赏:)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) 接口方向{ [[UIApplication shareApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft 动画:FALSE]; return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); }
I'm using the Paypal library in my iphone app. Its all working fine with my test account except for one little thing, orientation.
My app is in landscape and the screen generated by the PayPal lib is portrait, when I move back from the PayPal screen to my app the views are still all in landscape but the status bar moves to portrait, thus leaving a space where the bar usually sits and cutting off the left hand side of the view with the status bar.
I'm not doing anything strange code-wise just the normal orientation methods shown below. Any advice appreciated :)
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation{
[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft animated:FALSE];
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我会回来更新这个。我从来没有弄清楚如何解决这个问题,但这似乎是一个操作系统错误,因为我在 iPhone 上的其他本地 Apple 应用程序中看到过它出现的情况。 YouTube 应用程序就是一个例子,有时在纵向和横向之间切换可能会导致状态栏位于 worg 位置,提供图片。
我决定从应用程序中完全删除状态栏并将其全屏显示。希望很快就会发布修复程序!
Thought I'd come back and give an update to this one. I never did figure out how to fix this but it seems to be an OS bug as I've seen it appear in other native Apple apps on the iphone. The youtube app is an example, sometimes switching between portrait and landscape can result in the status bar being in the worg position, pic provided.
I've decided to remove the status bar completely from the app and have it full screen. hope theres's a fix released for this soon!