gpt4 book ai didi

ios - KAL 日历不允许为事件 ListView 选择任何行

转载 作者:行者123 更新时间:2023-11-29 10:45:05 25 4
gpt4 key购买 nike

我使用了下面的代码

- (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];

//当我在自定义 View 中添加 kal.view 时,它会显示事件列表,当我单击任何行时,它不会被推送到下一个 View 屏幕

    }

最佳答案

您必须在 KalView.m 文件中进行两处更改..

首先:在该类中,有一个 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];

第二:在同一个类中,还有一个方法,即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];

注释整个代码,因为这是在 HeaderView 中设置图像。

关于ios - KAL 日历不允许为事件 ListView 选择任何行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22680818/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com