Iphone 如何更改纵向模式

Iphone 如何更改纵向模式,iphone,Iphone,我正在创建一个与照片相关的应用程序,希望得到大家的帮助 从相册视图中,单击一张照片,它会在纵向模式下转到该照片的详细视图屏幕,如果您转向侧面,则会在横向模式下获得该照片。从这个横向模式,如果我们移动到上一个相册页面,我想在纵向模式下看到所有照片,但它返回到横向模式下的照片视图。从横向模式下的详细照片视图中,如果我们返回到相册视图,我如何对其进行编程,以便我们在纵向模式下而不是横向模式下查看相册视图?提前感谢您的帮助。在相册视图控制器中执行以下操作: - (BOOL)shouldAutorotat

我正在创建一个与照片相关的应用程序,希望得到大家的帮助


从相册视图中,单击一张照片,它会在纵向模式下转到该照片的详细视图屏幕,如果您转向侧面,则会在横向模式下获得该照片。从这个横向模式,如果我们移动到上一个相册页面,我想在纵向模式下看到所有照片,但它返回到横向模式下的照片视图。从横向模式下的详细照片视图中,如果我们返回到相册视图,我如何对其进行编程,以便我们在纵向模式下而不是横向模式下查看相册视图?提前感谢您的帮助。

在相册视图控制器中执行以下操作:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}
在详图视图控制器中执行以下操作:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}

在相册视图控制器中,执行以下操作:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}
在详图视图控制器中执行以下操作:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;
}

谢谢你的评论。已将UINavigationController添加到UIViewController。感谢您的评论。这是由于将UINavigationController添加到UIViewController。