UIStringAttributes Class
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.
Strongly helper to define UIKit attributes for use with NSAttributedString.
public class UIStringAttributes : Foundation.DictionaryContainer
type UIStringAttributes = class
inherit DictionaryContainer
- Inheritance
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() |
Default constructor |
UIStringAttributes(NSDictionary) |
Creates a UIStringAttributes from UIKit NSAttributedString attributes stored in a dictionary. |
Properties
BackgroundColor |
Background Color for the text. |
BaselineOffset |
The distance from the bottom of the bounding box of the glyphs of the string to their baseline. |
Dictionary |
Gets the wrapped NSDictionary. (Inherited from DictionaryContainer) |
Expansion |
The log of the expansion factor to be applied to glyphs. |
Font |
Font to use for the text. |
ForegroundColor |
Foreground Color for the text |
KerningAdjustment |
Kerning value used for the text |
Ligature |
The style of ligatures to use. |
Link |
The destination URL of a hyperlink. |
Obliqueness |
The amount of skew to apply to glyphs. |
ParagraphStyle |
Used to specify a custom paragraph style. |
Shadow |
Shadow to use for the text. |
StrikethroughColor |
The color to be used for the strikethrough stroke. |
StrikethroughStyle |
Strikethrough style. |
StrokeColor |
Stroke Color. |
StrokeWidth |
The stroke width for drawing the text |
TextAttachment |
The NSTextAttachment, if any. |
TextEffect |
The NSTextEffect applied to the string. |
UnderlineColor |
The color of the underline stroke. |
UnderlineStyle |
Underline style for the text. |
WeakTextEffect |
A reference to the text effect that does not prevent garbage collection of the underlying resource. |
WritingDirectionInt |
An array indicating the writing-direction overrides. |
Methods
GetArray<T>(NSString) |
Retrieves the array of type |
GetArray<T>(NSString, Func<IntPtr,T>) | (Inherited from DictionaryContainer) |
GetBoolValue(NSString) |
Returns the nullable Boolean associated with |
GetCGPointValue(NSString) |
Returns the nullable CGPoint associated with |
GetCGRectValue(NSString) |
Returns the nullable NSString associated with |
GetCGSizeValue(NSString) |
Returns the nullable CGSize associated with |
GetCMTimeValue(NSString) |
Returns the nullable CMTime associated with |
GetDoubleValue(NSString) |
Returns the nullable double associated with |
GetFloatValue(NSString) |
Returns the nullable float associated with |
GetInt32Value(NSString) |
Returns the nullable int associated with |
GetLongValue(NSString) |
Returns the nullable long associated with |
GetNativeValue<T>(NSString) |
Returns the native object associated with |
GetNIntValue(NSString) |
Returns the nullable native integer associated with |
GetNSDictionary(NSString) |
Returns the NSDictionary associated with |
GetNSDictionary<TKey,TValue>(NSString) |
Returns the NSDictionary associated with |
GetNSStringValue(NSString) |
Returns the NSString associated with |
GetNUIntValue(NSString) |
Returns the nullable native unsigned int associated with |
GetStringValue(NSString) |
Returns the string associated with |
GetStringValue(String) |
Returns the string associated with |
GetStrongDictionary<T>(NSString) |
Returns the DictionaryContainer associated with |
GetUInt32Value(NSString) |
Returns the nullable T:System.UInt32 associated with |
GetUIntValue(NSString) |
Returns the nullable T:System.UInt32 associated with |
RemoveValue(NSString) |
Removes from the dictionary the value associated with |
SetArrayValue(NSString, INativeObject[]) |
Associates the INativeObject array |
SetArrayValue(NSString, NSNumber[]) |
Associates the NSNumber array |
SetArrayValue(NSString, String[]) |
Associates the T:System.String array |
SetArrayValue<T>(NSString, T[]) |
Associates the array |
SetBooleanValue(NSString, Nullable<Boolean>) |
Stores the Boolean |
SetCGPointValue(NSString, Nullable<CGPoint>) |
Stores the CGPoint |
SetCGRectValue(NSString, Nullable<CGRect>) |
Stores the CGRect |
SetCGSizeValue(NSString, Nullable<CGSize>) |
Stores the CGSize |
SetCMTimeValue(NSString, Nullable<CMTime>) |
Stores the CMTime |
SetNativeValue(NSString, INativeObject, Boolean) | (Inherited from DictionaryContainer) |
SetNumberValue(NSString, Nullable<Double>) |
Stores the double |
SetNumberValue(NSString, Nullable<Int32>) |
Stores the int |
SetNumberValue(NSString, Nullable<Int64>) |
Stores the long |
SetNumberValue(NSString, Nullable<nint>) |
Stores the native integer |
SetNumberValue(NSString, Nullable<nuint>) |
Stores the native unsigned int |
SetNumberValue(NSString, Nullable<Single>) |
Stores the float |
SetNumberValue(NSString, Nullable<UInt32>) |
Stores the unsigned int |
SetStringValue(NSString, NSString) |
Stores the string |
SetStringValue(NSString, String) |
Stores the string |