Working with Text Data View

Operating system requirements: iOS 5.0 or later.

Mobile device: iPad.

Description

This example describes some methods of working with text data view. After starting the example the following operations are executed:

Source Code

Executing the example requires to place the following code in the body of the executeExample method of the ViewController class (see the Displaying of Dashboard section):

// Get dashboard
APKap *kap = [m_controller valueForKey:@"m_report"];
// Get dashboard controller
MADashboardReportViewController *kapDelegate = (MADashboardReportViewController *)[kap delegate];
// Create a controller for working with text data view
MATextDataViewController *textCtrl = [kapDelegate createTextDataViewController];
// Set text
[textCtrl setText:[NSString stringWithFormat:@"%@", [NSDate date]]];
// Set font settings
[textCtrl setFont:[UIFont fontWithFamily:@"Arial" bold:YES italic:NO withSize:20]];
// Set grey color
[textCtrl setColor:[UIColor grayColor]];
// Underline text
[textCtrl setUnderline:YES];
// Align text by center
[textCtrl setAlignment:NSTextAlignmentCenter];
// Display text label
[self showReport:textCtrl];

After executing the example the string with the current time is displayed. The text is underlined, colored with grey, aligned by the screen center. The Arial font of 20 pixels is set:

See also:

Example of Component Use