Operating system requirements: iOS 5.0 or later.
Mobile device: iPad.
This example implements changing of table pressed cell properties. The following is set for the cell: highlighted text color is set, cell highlighting is activated, text alignment by center is set, and text and its font are changed. Size, colors and arrays that determine order of dashes for cell dashed borders are also set.
Executing the example requires the following code after the executeExample method of the ViewController class (see the Creating a Simple Data Grid section):
// Handle table cell press event - (void)gridView:(NuGridView *)gridView wasTouchedInCell:(NuTextGridCell *)cell { // Set highlighted cell text color [cell setHighlightTextColor:[UIColor blueColor]]; // Enable cell highlighting [cell setIsHighLighted:YES]; // Set text alignment by center [cell setAlignment: NSTextAlignmentCenter]; // Set cell text [cell setText:@"Text"]; // Set cell font [cell setFont:[UIFont italicSystemFontOfSize:15]]; // Set cell top border width [cell setTopBorderWidth:8]; // Set cell bottom border width [cell setBottomBorderWidth:6]; // Set cell left border width [cell setLeftBorderWidth:4]; // Set cell right border width [cell setRightBorderWidth:2]; // Set cell top border color [cell setTopBorderColor:[UIColor redColor]]; // Set cell bottom border color [cell setBottomBorderColor:[UIColor blueColor]]; // Set cell left border color [cell setLeftBorderColor:[UIColor greenColor]]; // Set cell right border cell [cell setRightBorderColor:[UIColor yellowColor]]; // Determine array of values that determine order of border dashes NSArray *arr = @[@5,@3]; // Set array of values that determine order of border dashes [cell setBottomDash:arr]; [cell setTopDash:arr]; [cell setLeftDash:arr]; [cell setRightDash:arr]; };
After executing the example clicking the table cell changes its properties:
See also: