UIButton.SetImage(UIImage, UIControlState) Method

Definition

Sets the image for the specified button state.

[Foundation.Export("setImage:forState:")]
public virtual void SetImage (UIKit.UIImage image, UIKit.UIControlState forState);
abstract member SetImage : UIKit.UIImage * UIKit.UIControlState -> unit
override this.SetImage : UIKit.UIImage * UIKit.UIControlState -> unit

Parameters

image
UIImage

The image to set, pass null to clear it.

This parameter can be null.

forState
UIControlState
Attributes

Remarks

This member participates in the UIAppearance styling system. See the Appearance property and the AppearanceWhenContainedIn(Type[]) method.

Applies to