【问题标题】:Adding an Image to the calendar View in Iphone将图像添加到 Iphone 中的日历视图
【发布时间】:2011-12-06 11:48:39
【问题描述】:

我需要在 iPhone 的默认日历视图顶部添加一个图像。如果任何机构知道如何实现这一点,请回复。我正在使用 Tapku 库来显示日历。如果可以在那里实现,也可以使用 Kal 库。

下面附加了日历视图,我需要在此日历顶部的标题栏下方放置一个图像。日历需要在图像下方看到。

【问题讨论】:

标签: iphone objective-c ios


【解决方案1】:

创建 TKCalendarMonthViewController 的子类并覆盖 loadView:

- (void)loadView {

    [super loadView];

    // Get the frame of the calendar view
    CGRect frame = self.monthView.frame;

    // Shift it down to make room for the image view
    frame.origin.y += 50; 

    // Add your image view, e.g. :  

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, frame.size.width, 50.0)];
    [self.view addSubview:imageView];
}

如果您使用的是 TKCalendarMonthTableViewController,其中包括日历视图下方的表格,那么您也需要调整表格的大小。查看 TKCalendarMonthTableViewController 的 loadView 以了解它是如何设置的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-05-12
    • 1970-01-01
    • 1970-01-01
    • 2022-12-28
    • 1970-01-01
    • 2010-10-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多