Instance Method

setTitleColor:forState:

Sets the color of the title to use for the specified state.

Declaration

- (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;

Parameters

color

The color of the title to use for the specified state.

state

The state that uses the specified color. The possible values are described in UIControlState.

Discussion

In general, if a property is not specified for a state, the default is to use the UIControlStateNormal value. If the UIControlStateNormal value is not set, then the property defaults to a system value. Therefore, at a minimum, you should set the value for the normal state.

See Also

Configuring the Button Title

titleLabel

A view that displays the value of the currentTitle property for a button.

- titleForState:

Returns the title associated with the specified state.

- setTitle:forState:

Sets the title to use for the specified state.

- attributedTitleForState:

Returns the styled title associated with the specified state.

- setAttributedTitle:forState:

Sets the styled title to use for the specified state.

- titleColorForState:

Returns the title color used for a state.

- titleShadowColorForState:

Returns the shadow color of the title used for a state.

- setTitleShadowColor:forState:

Sets the color of the title shadow to use for the specified state.

reversesTitleShadowWhenHighlighted

A Boolean value that determines whether the title shadow changes when the button is highlighted.