这是EKEventEditViewController的错误吗?

时间:2010-12-31 19:19:33

标签: events ios calendar

I found EKEventEditViewController is not correct in 
UIInterfaceOrientationPortraitUpside.

Try this demo from your site, I just changed code as below, put simulator to 
UpSide Down Portrait mode, then click "+" button, you will find the screen in 
flash, this is due to dialog is upside in short time.

Then you can try it on device turn to UpSideDown mode, you will see what I am talking:)

I want to know why they have different view in Simulator or iPad even if it is 
not a bug.

Bug in SimpleEKDemo

1 个答案:

答案 0 :(得分:0)

基本上你想创建一个继承自EKEventEditViewController的自己的类,并使用它通常使用的任何地方使用EKEventEditViewController。例如,KonopEventEditViewController。

KonopEventEditViewController.h如下

#import <EventKitUI/EventKitUI.h>

@interface KonopEventEditViewController : EKEventEditViewController

@end

KonopEventEditViewController.m如下

#import "KonopEventEditViewController.h"

@interface KonopEventEditViewController ()

@end

@implementation KonopEventEditViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

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

@end