Inherits from SDataGridWrapper : NSObject
Declared in SDataGridCellStyle.h
Availability
Related samples

Overview

An object of this type is used, in certain circumatances, to provide a style that will be used for an SDataGridCell. If this object contains a style that cannot be applied to the cell in question then the style will be ignored - for example, we have a textColor and try to apply it to an SDataGridCell that has no text, then the textColor is ignored.

Note that where there are style conflicts, the application of style occurs according to the level of precidence. For example, if a cell is returned as having a blue background by applying this in the SDataGridDataSource protocol method shinobiDataGrid:prepareCellForDisplay: but we later specify that the row that the cell belongs to should have a red background (by implementing the SDataGridDelegate protocol), the cell will take on the most specific style. In this case we specify a row style and a cell style - therefore the most specific style is the cell style and so the cell in question will have a blue background. All other cells in the row will have a red background (unless a more specific style is applied elsewhere).

Most specific to least specific, the styling order is: Giving a cell a background color itself (this cannot be done with size). A style returned from a delegate method is checked next. If nil, or a specific member of the style is nil, the following is checked: The defaultColumnStyle and defaultRowStyle properties on the grid object owning the cell.

If no appropriate style is found, autosizing takes place and default styles are used.

Tasks

Initializing

Style Properties

  •   backgroundColor

    The color that will be used for the background of the cell.

    property
  •   textColor

    The color that will be used for the text of the cell.

    property
  •   textAlignment

    The horizontal alignment that will be used for the text of the cell.

    property
  •   font

    The font that will be used for the text of the cell.

    property
  •   textVerticalAlignment

    The vertical alignment that will be applied to any text within the cell.

    property
  •   gradient

    The gradient that will be applied to the cell

    property
  •   contentInset

    The indents that pad the inside of the cell

    property

Properties

backgroundColor

The color that will be used for the background of the cell.

@property (nonatomic, retain) UIColor *backgroundColor

Declared In

SDataGridCellStyle.h

contentInset

The indents that pad the inside of the cell

@property (nonatomic) UIEdgeInsets contentInset

Declared In

SDataGridCellStyle.h

font

The font that will be used for the text of the cell.

@property (nonatomic, retain) UIFont *font

Discussion

If the cell has no text then this property is ignored.

Declared In

SDataGridCellStyle.h

gradient

The gradient that will be applied to the cell

@property (nonatomic, retain) SDataGridGradient *gradient

Declared In

SDataGridCellStyle.h

textAlignment

The horizontal alignment that will be used for the text of the cell.

@property (nonatomic, assign) NSTextAlignment textAlignment

Discussion

If the cell has no text then this property is ignored.

Declared In

SDataGridCellStyle.h

textColor

The color that will be used for the text of the cell.

@property (nonatomic, retain) UIColor *textColor

Discussion

If the cell has no text then this property is ignored.

Declared In

SDataGridCellStyle.h

textVerticalAlignment

The vertical alignment that will be applied to any text within the cell.

@property (nonatomic, assign) UIControlContentVerticalAlignment textVerticalAlignment

Discussion

If the cell has no text then this property is ignored.

Declared In

SDataGridCellStyle.h

Class Methods

styleWithBackgroundColor:withTextColor:withFont:

Returns an autoreleased style object using the corresponding initWith... method.

+ (id)styleWithBackgroundColor:(UIColor *)backgroundColor withTextColor:(UIColor *)textColor withFont:(UIFont *)font

Declared In

SDataGridCellStyle.h

styleWithBackgroundColor:withTextColor:withTextAlignment:withVerticalTextAlignment:withFont:

Returns an autoreleased style object using the corresponding initWith... method.

+ (id)styleWithBackgroundColor:(UIColor *)backgroundColor withTextColor:(UIColor *)textColor withTextAlignment:(NSTextAlignment)textAlignment withVerticalTextAlignment:(UIControlContentVerticalAlignment)textVerticalAlignment withFont:(UIFont *)font

Declared In

SDataGridCellStyle.h

Instance Methods

initWithBackgroundColor:withTextColor:withFont:

Returns a style object that represents the passed parameters. Passing nil to any parameter results in a default value being used.

- (id)initWithBackgroundColor:(UIColor *)backgroundColor withTextColor:(UIColor *)textColor withFont:(UIFont *)font

Declared In

SDataGridCellStyle.h

initWithBackgroundColor:withTextColor:withTextAlignment:withVerticalTextAlignment:withFont:

Returns a style object that represents the passed parameters. Passing nil to any parameter results in a default value being used.

- (id)initWithBackgroundColor:(UIColor *)backgroundColor withTextColor:(UIColor *)textColor withTextAlignment:(NSTextAlignment)textAlignment withVerticalTextAlignment:(UIControlContentVerticalAlignment)textVerticalAlignment withFont:(UIFont *)font

Declared In

SDataGridCellStyle.h