Adding the Slide Tab View to a View
Send Feedback

Glossary Item Box

Topic Overview

Purpose

This topic explains, with a code example how to create an instance of the IGSlideTabView™ control and show it on a view.

Required background

The following table lists the prerequisite topics 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 the IGSlideTabView – Code Example

Description

This code example illustrates the creation of a slide tab item with the content area set to 200x200. After which, it is added to a slide tab view.

Preview

Code

To start, set the background color of the view controller’s to white.

In Objective-C:

self.view.backgroundColor = [UIColor whiteColor];

In C#:

this.View.BackgroundColor = UIColor.White;

Next, create an instance of the IGSlideTabView that takes the size of the view controller’s bounds and add the view as a subview.

In Objective-C:

IGSlideTabView *slideTabView = [[IGSlideTabView alloc] init];
slideTabView.frame = self.view.bounds;
slideTabView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
[self.view addSubview:slideTabView];

In C#:

IGSlideTabView slideTabView = new IGSlideTabView ();
slideTabView.Frame = this.View.Bounds;
slideTabView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
this.View.Add (slideTabView);

Next, use the tabWithLocation:title:tabView:contentView: static method to create an IGSlideTabItem instance that has a content size of 200x200.

In Objective-C:

IGSlideTabItem *slideTabItem = [IGSlideTabItem tabWithLocation:IGSlideTabLocationBottom
                                               title:@"Getting Started"
                                               tabView:nil
                                               contentView:nil];
slideTabItem.contentSize = [IGSlideTabContentSize sizeWithWidth:200 height:200];

In C#:

IGSlideTabItem slideTabItem = new IGSlideTabItem ();
slideTabItem.TabLocation = IGSlideTabLocation.IGSlideTabLocationBottom;
slideTabItem.Title = "Getting Started";
slideTabItem.ContentSize = IGSlideTabContentSize.CreateFixedSize (200, 200);

Finally, add the slide tab item to the slide tab view.

In Objective-C:

 [slideTabView addTab:slideTabItem];

In C#:

slideTabView.AddTab (slideTabItem);

Related Content

Topics

The following topic provides additional information related to this topic.

Topic

Purpose

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