UIButton.SetAttributedTitle(NSAttributedString, UIControlState) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the button title with an attributed string for a particular control state.
[Foundation.Export("setAttributedTitle:forState:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual void SetAttributedTitle (Foundation.NSAttributedString title, UIKit.UIControlState state);
abstract member SetAttributedTitle : Foundation.NSAttributedString * UIKit.UIControlState -> unit
override this.SetAttributedTitle : Foundation.NSAttributedString * UIKit.UIControlState -> unit
Parameters
- title
- NSAttributedString
The attributed string to set.
- state
- UIControlState
The scope for the text.
- Attributes
Remarks
var title = new NSAttributedString (
"Hello, World",
font: UIFont.FromName ("HoeflerText-Regular", 24.0f),
foregroundColor: UIColor.Red,
strokeWidth: 4
);
myButton.SetAttributedTitle (title, UIControlState.Normal);