UIStringAttributes UIStringAttributes Class

Definition

Strongly helper to define UIKit attributes for use with NSAttributedString.

public class UIStringAttributes : Foundation.DictionaryContainer
type UIStringAttributes = class
    inherit DictionaryContainer
Inheritance
UIStringAttributesUIStringAttributes

Remarks

You use this class to create attributes that can be used with both NSAttributedString and NSMutableAttributedString. Since this class is strongly typed, you will get code completion as well as avoid common mistakes when using attributed strings with UIKit.


// 
// Using NSAttributedString with UIKit
//
var myText = new NSAttributedString ("Hello, world",
       new UIStringAttributes () {
              ForegroundColor =  UIColor.Red,
	      KerningAdjustment = 3
       });
label.AttributedText = myText;

Constructors

UIStringAttributes() UIStringAttributes()

Default constructor

UIStringAttributes(NSDictionary) UIStringAttributes(NSDictionary)

Creates a UIStringAttributes from UIKit NSAttributedString attributes stored in a dictionary.

Properties

BackgroundColor BackgroundColor

Background Color for the text.

BaselineOffset BaselineOffset

The distance from the bottom of the bounding box of the glyphs of the string to their baseline.

Dictionary Dictionary

Gets the wrapped NSDictionary.

(Inherited from DictionaryContainer)
Expansion Expansion

The log of the expansion factor to be applied to glyphs.

Font Font

Font to use for the text.

ForegroundColor ForegroundColor

Foreground Color for the text

KerningAdjustment KerningAdjustment

Kerning value used for the text

Ligature Ligature

The style of ligatures to use.

Link Link

The destination URL of a hyperlink.

Obliqueness Obliqueness

The amount of skew to apply to glyphs.

ParagraphStyle ParagraphStyle

Used to specify a custom paragraph style.

Shadow Shadow

Shadow to use for the text.

StrikethroughColor StrikethroughColor

The color to be used for the strikethrough stroke.

StrikethroughStyle StrikethroughStyle

Strikethrough style.

StrokeColor StrokeColor

Stroke Color.

StrokeWidth StrokeWidth

The stroke width for drawing the text

TextAttachment TextAttachment

The NSTextAttachment, if any.

TextEffect TextEffect

The NSTextEffect applied to the string.

UnderlineColor UnderlineColor

The color of the underline stroke.

UnderlineStyle UnderlineStyle

Underline style for the text.

WeakTextEffect WeakTextEffect

A reference to the text effect that does not prevent garbage collection of the underlying resource.

WritingDirectionInt WritingDirectionInt

An array indicating the writing-direction overrides.

Methods

GetArray<T>(NSString) GetArray<T>(NSString)

Retrieves the array of type T associated with key.

(Inherited from DictionaryContainer)
GetArray<T>(NSString, Func<IntPtr,T>) GetArray<T>(NSString, Func<IntPtr,T>) Inherited from DictionaryContainer
GetBoolValue(NSString) GetBoolValue(NSString)

Returns the nullable Boolean associated with key.

(Inherited from DictionaryContainer)
GetCGPointValue(NSString) GetCGPointValue(NSString)

Returns the nullable CGPoint associated with key.

(Inherited from DictionaryContainer)
GetCGRectValue(NSString) GetCGRectValue(NSString)

Returns the nullable NSString associated with key.

(Inherited from DictionaryContainer)
GetCGSizeValue(NSString) GetCGSizeValue(NSString)

Returns the nullable CGSize associated with key.

(Inherited from DictionaryContainer)
GetCMTimeValue(NSString) GetCMTimeValue(NSString)

Returns the nullable CMTime associated with key.

(Inherited from DictionaryContainer)
GetDoubleValue(NSString) GetDoubleValue(NSString)

Returns the nullable double associated with key.

(Inherited from DictionaryContainer)
GetFloatValue(NSString) GetFloatValue(NSString)

Returns the nullable float associated with key.

(Inherited from DictionaryContainer)
GetInt32Value(NSString) GetInt32Value(NSString)

Returns the nullable int associated with key.

(Inherited from DictionaryContainer)
GetLongValue(NSString) GetLongValue(NSString)

Returns the nullable long associated with key.

(Inherited from DictionaryContainer)
GetNativeValue<T>(NSString) GetNativeValue<T>(NSString)

Returns the native object associated with key.

(Inherited from DictionaryContainer)
GetNIntValue(NSString) GetNIntValue(NSString)

Returns the nullable native integer associated with key.

(Inherited from DictionaryContainer)
GetNSDictionary(NSString) GetNSDictionary(NSString)

Returns the NSDictionary associated with key.

(Inherited from DictionaryContainer)
GetNSDictionary<TKey,TValue>(NSString) GetNSDictionary<TKey,TValue>(NSString)

Returns the NSDictionary associated with key.

(Inherited from DictionaryContainer)
GetNSStringValue(NSString) GetNSStringValue(NSString)

Returns the NSString associated with key.

(Inherited from DictionaryContainer)
GetNUIntValue(NSString) GetNUIntValue(NSString)

Returns the nullable native unsigned int associated with key.

(Inherited from DictionaryContainer)
GetStringValue(NSString) GetStringValue(NSString)

Returns the string associated with key.

(Inherited from DictionaryContainer)
GetStringValue(String) GetStringValue(String)

Returns the string associated with key.

(Inherited from DictionaryContainer)
GetStrongDictionary<T>(NSString) GetStrongDictionary<T>(NSString)

Returns the DictionaryContainer associated with key.

(Inherited from DictionaryContainer)
GetUInt32Value(NSString) GetUInt32Value(NSString)

Returns the nullable T:System.UInt32 associated with key.

(Inherited from DictionaryContainer)
GetUIntValue(NSString) GetUIntValue(NSString)

Returns the nullable T:System.UInt32 associated with key.

(Inherited from DictionaryContainer)
RemoveValue(NSString) RemoveValue(NSString)

Removes from the dictionary the value associated with key.

(Inherited from DictionaryContainer)
SetArrayValue(NSString, INativeObject[]) SetArrayValue(NSString, INativeObject[])

Associates the INativeObject array values with key.

(Inherited from DictionaryContainer)
SetArrayValue(NSString, NSNumber[]) SetArrayValue(NSString, NSNumber[])

Associates the NSNumber array values with key.

(Inherited from DictionaryContainer)
SetArrayValue(NSString, String[]) SetArrayValue(NSString, String[])

Associates the T:System.String array values with key.

(Inherited from DictionaryContainer)
SetArrayValue<T>(NSString, T[]) SetArrayValue<T>(NSString, T[])

Associates the array values of type T with key.

(Inherited from DictionaryContainer)
SetBooleanValue(NSString, Nullable<Boolean>) SetBooleanValue(NSString, Nullable<Boolean>)

Stores the Boolean value and associates it with the key.

(Inherited from DictionaryContainer)
SetCGPointValue(NSString, Nullable<CGPoint>) SetCGPointValue(NSString, Nullable<CGPoint>)

Stores the CGPointvalue and associates it with the key.

(Inherited from DictionaryContainer)
SetCGRectValue(NSString, Nullable<CGRect>) SetCGRectValue(NSString, Nullable<CGRect>)

Stores the CGRectvalue and associates it with the key.

(Inherited from DictionaryContainer)
SetCGSizeValue(NSString, Nullable<CGSize>) SetCGSizeValue(NSString, Nullable<CGSize>)

Stores the CGSizevalue and associates it with the key.

(Inherited from DictionaryContainer)
SetCMTimeValue(NSString, Nullable<CMTime>) SetCMTimeValue(NSString, Nullable<CMTime>)

Stores the CMTimevalue and associates it with the key.

(Inherited from DictionaryContainer)
SetNativeValue(NSString, INativeObject, Boolean) SetNativeValue(NSString, INativeObject, Boolean) Inherited from DictionaryContainer
SetNumberValue(NSString, Nullable<Double>) SetNumberValue(NSString, Nullable<Double>)

Stores the double value (or null) and associates it with the key.

(Inherited from DictionaryContainer)
SetNumberValue(NSString, Nullable<Int32>) SetNumberValue(NSString, Nullable<Int32>)

Stores the int value (or null) and associates it with the key.

(Inherited from DictionaryContainer)
SetNumberValue(NSString, Nullable<Int64>) SetNumberValue(NSString, Nullable<Int64>)

Stores the long value (or null) and associates it with the key.

(Inherited from DictionaryContainer)
SetNumberValue(NSString, Nullable<nint>) SetNumberValue(NSString, Nullable<nint>)

Stores the native integer value (or null) and associates it with the key.

(Inherited from DictionaryContainer)
SetNumberValue(NSString, Nullable<nuint>) SetNumberValue(NSString, Nullable<nuint>)

Stores the native unsigned int value (or null) and associates it with the key.

(Inherited from DictionaryContainer)
SetNumberValue(NSString, Nullable<Single>) SetNumberValue(NSString, Nullable<Single>)

Stores the float value (or null) and associates it with the key.

(Inherited from DictionaryContainer)
SetNumberValue(NSString, Nullable<UInt32>) SetNumberValue(NSString, Nullable<UInt32>)

Stores the unsigned int value (or null) and associates it with the key.

(Inherited from DictionaryContainer)
SetStringValue(NSString, NSString) SetStringValue(NSString, NSString)

Stores the string value and associates it with the key.

(Inherited from DictionaryContainer)
SetStringValue(NSString, String) SetStringValue(NSString, String)

Stores the string value and associates it with the key.

(Inherited from DictionaryContainer)

Applies to