Instance Property

translucent

A Boolean value that indicates whether the search bar is translucent (YES) or not (NO).

Declaration

@property(nonatomic, assign, getter=isTranslucent) BOOL translucent;

Discussion

The default value is YES. If the search bar has a custom background image, the default is YES if any pixel of the image has an alpha value of less than 1.0, and NO otherwise.

If you set this property to YES on a search bar with an opaque custom background image, the search bar will apply a system opacity less than 1.0 to the image.

If you set this property to NO on a search bar with a translucent custom background image, the search bar provides an opaque background for the image using black if the search bar has UIBarStyleBlack style, white if the search bar has UIBarStyleDefault, or the search bar’s barTintColor if a custom value is defined.

See Also

Display Attributes

barStyle

A bar style that specifies the search bar’s appearance.

barTintColor

The tint color to apply to the search bar background.

searchBarStyle

A search bar style that specifies the search bar’s appearance.

tintColor

The tint color to apply to key elements in the search bar.