通过方向更改视图布局
我正在开发一个应用程序,我希望当设备旋转时视图会发生很大的变化。我知道在 Interface Builder 中可以更改方向并在那里设置布局,但是当我将其旋转为纵向时,视图与横向视图相同。有没有办法独立设置两个视图,也许使用两个笔尖?
干杯, 太平绅士
I am working on an application where I want the view to change quite a lot when the device is rotated. I know that in Interface Builder it is possible to change the orientation and set up the layout there, however when I then rotate it to portrait, the view is the same as for the landscape. Is there a way to set up the two views independently, perhaps using two nibs?
Cheers,
JP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在方向更改时切换视图控制器(例如 iPod 应用程序显示其封面视图时),以下帖子将有所帮助:
http://rndnext.blogspot.com/2009_06_01_archive.html
If you're after switching view controllers on orientation changes, like when the iPod app shows it's coverflow view, the following post will help:
http://rndnext.blogspot.com/2009_06_01_archive.html
我不知道你是否可以在IB中做到这一点,但我知道你可以在代码中做到这一点。您需要观察 UIDeviceOrientationDidChangeNotification 通知:(
在 viewDidLoad...)
...
I don't know if you can do it in IB, but I know you can do it in code. You need to observe the UIDeviceOrientationDidChangeNotification Notification:
(in viewDidLoad...)
....