UIModalTransitionStylePartialCurl无法恢复到以前的状态。 (不解雇) [英] UIModalTransitionStylePartialCurl doesn't get back to previous state. (Not dismissing)
问题描述
我有2个视图控制器,让我们说A和B.在A中,我调用B来显示过渡样式 UIModalTransitionStylePartialCurl
I've got 2 view controllers, let's say A and B. In A, I'm calling B to be shown with transition style UIModalTransitionStylePartialCurl
[b setModalTransitionStyle:UIModalTransitionStylePartialCurl];
[self presentModalViewController:b animated:YES];
工作正常。但是当我按下用iOS 4.3编译的程序中的卷曲区域时。它完全没有解雇。它没有回到A视图控制器......
It is working fine. However when I press the curled area in the program compiled with iOS 4.3. It does not dismiss at all. It doesn't get back to A view controller...
最有趣的是这个curl是活动的,并在用iOS 5.0编译的应用程序中给出响应。
What the most interesting is that this curl is active and giving response in the app compiled with iOS 5.0.
如何解决这个问题?
此外,为什么不解除B视图控制器并返回A?
How can I resolve this problem?
Moreover, why doesn't it dismiss the B view controller and get back to A ?
推荐答案
以下是模态视图控制器
基本上,您需要设置委托等等。 dismissModalViewControllerAnimated:来自你的viewcontroller的方法A.如果你需要进一步的帮助,请告诉我。
Basically, you need to setup delegate, etc. And call dismissModalViewControllerAnimated: method from your viewcontroller A. Let me know if you need further help.
根据MiiChiel进行编辑:
Edit per MiiChiel:
在BController.h文件中,添加:
In BController.h file, add this:
@protocol BControllerDelegate <NSObject>
-(void)dismissMe;
@end
@interface BController : UIViewController
//...
@property (assign) id <BControllerDelegate> delegate;
//...
@end
在BController.m文件中,添加这个:
In BController.m file, add this:
@implementation BController
@synthesize delegate;
//...
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[self.delegate dismissMe];
}
在AController.h文件中,添加:
In the AController.h file, add this:
#import "BController.h"
@interface AController : UIViewController <BControllerDelegate>
在AController.m文件中,添加:
In the AController.m file, add this:
//add this line before presenting the modal view controller B
bController.delegate = self; // assuming bController is the name of the modal
-(void)dismissMe
{
//call back from modal view to dismiss it
[self dismissModalViewControllerAnimated:YES];
}
这篇关于UIModalTransitionStylePartialCurl无法恢复到以前的状态。 (不解雇)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!