Adding the Calendar to a View
Send Feedback

Glossary Item Box

Topic Overview

Purpose

This topic explains, with a code example how to create a basic instance of the IGCalendarView™ control and display it on a view.

Required background

The following table lists the prerequisite topic required to understanding this topic.

Topic

Purpose

Adding the IG Framework File

This topic explains how to add the IG framework file to a project.


In this topic


Displaying an IGCalendarView – Code Example

Description

This code example illustrates how to create and subsequently add an instance of the IGCalendarView to a view.

Preview

Code

To start, initialize the IGCalendarView instance with its frame size and position.

In Objective-C:

IGCalendarView *calendar = [[IGCalendarView alloc] initWithFrame:self.view.bounds];

In C#:

IGCalendarView calendar = new IGCalendarView ();
calendar.Frame = this.View.Bounds;

Next, set the auto-resizing mask to allow the calendar to take the full height and width in both landscape and portrait orientations.

In Objective-C:

calendar.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;

In C#:

calendar.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;

Finally, add the calendar to the view.

In Objective-C:

 [self.view addSubview:calendar];

In C#:

this.View.Add (calendar);

Related Content

Topics

The following topic provides additional information related to this topic.

Topic

Purpose

This topic provides a conceptual overview of the IGCalendarView control and its key features.