【问题标题】:Include a calendar view and maintain the navigation bar包括日历视图并维护导航栏
【发布时间】:2013-12-18 13:54:18
【问题描述】:

在我的 iOS 应用程序中,我想在 viewController 中包含一个日历视图(Vurig Calendar)。这是添加日历视图之前视图控制器的屏幕截图

可以看到视图上方有一个导航栏和一个tableview。 然后,我在 viewDidLoad 方法中包含以下代码以显示日历:

VRGCalendarView *calendario = [[VRGCalendarView alloc] init];
    calendario.delegate=self;
    [self.view addSubview:calendario];

现在日历出现在视图上,但导航栏消失了: 请告诉我如何包含日历视图和导航栏。 提前谢谢你。

我已经包含了@Balram Tiwari 提出的代码:

VRGCalendarView *calendario = [[VRGCalendarView alloc] initWithFrame:CGRectMake(0, 60, 330, 280)];
calendario.delegate=self;
[self.view addSubview:calendario];

  1. 根据需要显示导航栏。
  2. 显示日历视图,但没有月份标题和黑色,而不是带有日期的单元格。
  3. 导航箭头无法按预期工作。

知道如何解决这些问题吗?如果有用,我可以输入所需的代码.... 再次感谢您。

【问题讨论】:

    标签: ios objective-c ios7 calendar


    【解决方案1】:

    我在这个日历控件中没有看到任何自定义方法。所以可以直接打开组件的.m文件VRGCalendarView.m修改init方法。

    -(id)init {
        self = [super initWithFrame:CGRectMake(0, YOUR_Y_COORDINATE, kVRGCalendarViewWidth, 0)]; 
    ...
    ...
    }
    

    此解决方案有效。

    【讨论】:

    • 谢谢@Balram Tiwari,我会检查并实施你的建议,稍后我会告诉你...
    • 我已编辑我的问题以添加您的提案结果。谢谢。
    • 你的第二个提案成功了。谢谢@Baram Tiwari。
    • 是的,我的意思是说,你打开组件然后相应地调整 Y 组件。我将编辑答案以仅反映有效的解决方案。
    猜你喜欢
    • 1970-01-01
    • 2015-06-23
    • 1970-01-01
    • 2014-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-27
    • 2017-10-26
    相关资源
    最近更新 更多