简体   繁体   English

KAL日历不允许为事件列表tableview选择任何行

[英]KAL Calendar does not allow select any row for the list of events tableview

I used below code 我用下面的代码

- (void)viewDidLoad
    {

      EKEventStore * store = [[EKEventStore alloc] init];

        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dateSelected:) name:@"D" object:nil];

        KalViewController *kal = [[KalViewController alloc] init];
        kal.delegate = self;
        kal.title= [NSString stringWithFormat:@"%@",kal.selectedDate];
        [kal loadView];

        EventKitDataSource * dataSource = [[EventKitDataSource alloc]init];
        kal.dataSource = dataSource;

         navController = [[UINavigationController alloc] initWithRootViewController:kal];
        [self.customView addSubview:kal.view];

// when I add kal.view inside of my custom view then It displays the list of events and when I click on any row then It does not get pushed to next view screen //当我在自定义视图中添加kal.view时,它会显示事件列表;当我单击任意行时,它不会被推送到下一个视图屏幕

    }

You have to make change two changes in KalView.m file.. 您必须在KalView.m文件中进行两次更改。

First :In that class,there is an initwithFrame method in which you will get this below code.In that you can change color as per your requirement.. 首先 :在该类中,有一个initwithFrame方法,您将在下面的代码中获得此方法。您可以根据需要更改颜色。

   UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0.f, 0.f, frame.size.width, kHeaderHeight)] autorelease];
headerView.backgroundColor = [UIColor orangeColor];
[self addSubviewsToHeaderView:headerView];
[self addSubview:headerView];

Second :In the same class ,there is a one more method ie addSubviewsToHeaderView: In that method you will get this code 第二 :在同一类中,还有一个方法,即addSubviewsToHeaderView:在该方法中,您将获得此代码

//Header background gradient
UIImageView *backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Kal.bundle/kal_grid_background.png"]];
CGRect imageFrame = headerView.frame; 
imageFrame.origin = CGPointZero;
backgroundView.frame = imageFrame;
[headerView addSubview:backgroundView];
[backgroundView release];

Comment this whole code because this is setting image in HeaderView.. 注释整个代码,因为这是在HeaderView中设置图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM