UINavigationController后退按钮是否在横向模式下出现问题? [英] UINavigationController back button problem in landscape mode?

查看:54
本文介绍了UINavigationController后退按钮是否在横向模式下出现问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iPhone应用程序较早支持纵向模式,现在我也希望支持横向模式.

在我的应用程序中,除导航控制器的后退"按钮外,其他所有东西都工作正常. 我在navigaton conroller中使用过tableviews,当我在横向模式下单击后退"按钮时,该视图会弹出并加载其先前的视图,但是动画很奇怪.

我给了默认的动画,但是在横向模式下,动画是颠倒的,而不是当我单击后退"按钮时默认为动画.

有人遇到这种问题吗??? 预先感谢.

解决方案

我理解了这个问题,下面是解决方法... 我要推入导航控制器的每个viewcontroller都应具有以下委托方法.

每个视图控制器应确认其支持方向更改

  • (BOOL)应该AutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { self.orientation = interfaceOrientation; 返回是; }

my iphone application supports portrait mode earlier, now i want to support land scape mode also.

everything is working fine in my application except the navigation controller back button. i have used tableviews in navigaton conroller, when i click back button in landscape mode view is getting poped and its loading its previous view but animation is strange.

i have given default animation but, in landscape mode view is is animating upside down instead of default left to rite when i click back button.

does anyone faced this kind of problem??? thanks in advance.

解决方案

i understood the problem and below is the solution... each viewcontroller which i am pushing into navigation controllers should have the following delegate method.

each view controller should confirm that it is supporting the orientation change

  • (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { self.orientation = interfaceOrientation; return YES; }

这篇关于UINavigationController后退按钮是否在横向模式下出现问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆