UIKit.UIButton.SetAttributedTitle Method
Sets the button title with an attributed string for a particular control state.

Syntax

[Foundation.Export("setAttributedTitle:forState:")]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_6_0)]
public virtual void SetAttributedTitle (Foundation.NSAttributedString title, UIControlState state)

Parameters

title
The attributed string to set.
state
The scope for the text.

Remarks

C# Example

var title = new NSAttributedString (
    "Hello, World",
    font: UIFont.FromName ("HoeflerText-Regular", 24.0f),
    foregroundColor: UIColor.Red,
    strokeWidth: 4
);
myButton.SetAttributedTitle (title, UIControlState.Normal);
	    

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0