【发布时间】:2014-04-02 01:02:00
【问题描述】:
我意识到关于这个问题有几个线程。但是,我对此并不陌生,我发现的一些解决方案对我不起作用。
我有一个 iPhone 应用程序,它应该支持除一个视图之外的所有方向。这个视图我只想锁定纵向。我试过这段代码,但是当我翻转手机时它仍然进入横向模式......我做错了什么?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
【问题讨论】:
标签: ios orientation