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-typed 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
| Name | Description |
|---|---|
| UIStringAttributes() |
Initializes a new instance of the UIStringAttributes class. |
| UIStringAttributes(NSDictionary) |
Creates a UIStringAttributes from UIKit NSAttributedString attributes stored in a dictionary. |
Properties
| Name | Description |
|---|---|
| BackgroundColor |
Gets or sets the background color for the text. |
| BaselineOffset |
Gets or sets 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 |
Gets or sets the log of the expansion factor to be applied to glyphs. |
| Font |
Gets or sets the font to use for the text. |
| ForegroundColor |
Gets or sets the foreground color for the text. |
| KerningAdjustment |
Gets or sets the kerning value used for the text. |
| Ligature |
Gets or sets the style of ligatures to use. |
| Link |
Gets or sets the destination URL of a hyperlink. |
| Obliqueness |
Gets or sets the amount of skew to apply to glyphs. |
| ParagraphStyle |
Gets or sets a custom paragraph style. |
| Shadow |
Gets or sets the shadow to use for the text. |
| StrikethroughColor |
Gets or sets the color to be used for the strikethrough stroke. |
| StrikethroughStyle |
Gets or sets the strikethrough style. |
| StrokeColor |
Gets or sets the stroke color. |
| StrokeWidth |
Gets or sets the stroke width for drawing the text. |
| TextAttachment |
Gets or sets the NSTextAttachment, if any. |
| TextEffect |
Gets or sets the NSTextEffect applied to the string. |
| UnderlineColor |
Gets or sets the color of the underline stroke. |
| UnderlineStyle |
Gets or sets the underline style for the text. |
| WeakTextEffect |
Gets or sets the weak reference to the text effect as an NSString. |
| WritingDirectionInt |
Gets or sets an array indicating the writing-direction overrides. |
Methods
| Name | Description |
|---|---|
| GetArray<T>(NSString, Func<NativeHandle,T>) |
Returns the nullable array of |
| GetArray<T>(NSString) |
Returns the nullable array of |
| GetArrayOfDictionariesValue<T>(NSString) |
Retrieves the DictionaryContainer array associeted with |
| GetBoolValue(NSString) |
Returns the nullable Boolean associated with the specified |
| GetByteValue(NSString) |
Returns the nullable Byte associated with the specified |
| GetCGPointValue(NSString) |
Returns the nullable CGPoint associated with |
| GetCGRectValue(NSString) |
Returns the nullable CGRect associated with |
| GetCGSizeValue(NSString) |
Returns the nullable CGSize associated with |
| GetCMTimeValue(NSString) |
Returns the nullable CMTime associated with |
| GetDateTimeValue(NSString) |
Returns the nullable DateTime associated with |
| GetDoubleValue(NSString) |
Returns the nullable Double associated with the specified |
| GetFloatValue(NSString) |
Returns the nullable Single associated with the specified |
| GetInt16Value(NSString) |
Returns the nullable Int16 associated with the specified |
| GetInt32Value(NSString) |
Returns the nullable Int32 associated with the specified |
| GetLongValue(NSString) |
Returns the nullable Int64 associated with the specified |
| GetNativeValue<T>(NSString) |
Returns the nullable |
| GetNFloatValue(NSString) |
Returns the nullable NFloat associated with the specified |
| GetNIntValue(NSString) |
Returns the nullable IntPtr associated with the specified |
| GetNSDataAsValueType<T>(NSString) |
Returns an NSData with the contents of a value type of type |
| GetNSDictionary(NSString) |
Returns the nullable NSDictionary associated with |
| GetNSDictionary<TKey,TValue>(NSString) |
Returns the nullable NSDictionary<TKey,TValue> associated with |
| GetNSStringValue(NSString) |
Returns the nullable NSString associated with |
| GetNUIntValue(NSString) |
Returns the nullable UIntPtr associated with the specified |
| GetSByteValue(NSString) |
Returns the nullable SByte associated with the specified |
| GetStringArrayValue(NSString) |
Returns the nullable string array associated with |
| GetStringValue(NSString) |
Returns the nullable String associated with |
| GetStringValue(String) |
Returns the nullable String associated with |
| GetStrongDictionary<T>(NSString, Func<NSDictionary,T>) |
Returns the nullable |
| GetStrongDictionary<T>(NSString) |
Returns the nullable |
| GetUIEdgeInsets(NSString) |
Returns the nullable UIEdgeInsets associated with |
| GetUInt16Value(NSString) |
Returns the nullable UInt16 associated with the specified |
| GetUInt32Value(NSString) |
Returns the nullable UInt32 associated with the specified |
| GetUIntValue(NSString) |
Returns the nullable UInt32 associated with the specified |
| GetULongValue(NSString) |
Returns the nullable UInt64 associated with the specified |
| RemoveValue(NSString) |
Removes from the dictionary the value associated with |
| SetArrayOfDictionariesValue(NSString, DictionaryContainer[]) |
Associates a DictionaryContainer array |
| SetArrayValue(NSString, INativeObject[]) |
Associates an array of INativeObject with |
| SetArrayValue(NSString, NSNumber[]) |
Associates the NSNumber array |
| SetArrayValue(NSString, String[]) |
Associates a |
| SetArrayValue<T>(NSString, T[], Func<T,NativeHandle>) |
Associates an array of |
| SetArrayValue<T>(NSString, T[]) |
Associates an array of |
| SetBooleanValue(NSString, Nullable<Boolean>) |
Associates a nullable Boolean with |
| SetCGPointValue(NSString, Nullable<CGPoint>) |
Associates a nullable CGPoint value with |
| SetCGRectValue(NSString, Nullable<CGRect>) |
Associates a nullable CGRect value with |
| SetCGSizeValue(NSString, Nullable<CGSize>) |
Associates a nullable CGSize value with |
| SetCMTimeValue(NSString, Nullable<CMTime>) |
Associates a nullable CMTime value with |
| SetNativeValue(NSString, INativeObject, Boolean) |
Associates a nullable INativeObject value with |
| SetNumberValue(NSString, Nullable<Byte>) |
Associates a nullable Byte with |
| SetNumberValue(NSString, Nullable<Double>) |
Associates a nullable Double with |
| SetNumberValue(NSString, Nullable<Int16>) |
Associates a nullable Int16 with |
| SetNumberValue(NSString, Nullable<Int32>) |
Associates a nullable Int32 with |
| SetNumberValue(NSString, Nullable<Int64>) |
Associates a nullable Int64 with |
| SetNumberValue(NSString, Nullable<IntPtr>) |
Associates a nullable IntPtr with |
| SetNumberValue(NSString, Nullable<NFloat>) |
Associates a nullable NFloat with |
| SetNumberValue(NSString, Nullable<SByte>) |
Associates a nullable SByte with |
| SetNumberValue(NSString, Nullable<Single>) |
Associates a nullable Single with |
| SetNumberValue(NSString, Nullable<UInt16>) |
Associates a nullable UInt16 with |
| SetNumberValue(NSString, Nullable<UInt32>) |
Associates a nullable UInt32 with |
| SetNumberValue(NSString, Nullable<UInt64>) |
Associates a nullable UInt64 with |
| SetNumberValue(NSString, Nullable<UIntPtr>) |
Associates a nullable UIntPtr with |
| SetStringValue(NSString, NSString) |
Associates a nullable NSString with |
| SetStringValue(NSString, String) |
Associates a nullable String with |
| SetUIEdgeInsets(NSString, Nullable<UIEdgeInsets>) |
Associates a nullable UIEdgeInsets value with |
| SetValueTypeAsNSData<T>(NSString, Nullable<T>) |
Sets an NSData with the contents of a value type of type |
| TryGetNativeValue(NSString, NativeHandle) |
Returns the handle associated with |
| TryGetNSObject<T>(NSString, T) |
Returns the nullable |