语言

NSMutableAttributedString 类

定义

[Foundation.Register("NSMutableAttributedString", true)]
public class NSMutableAttributedString : Foundation.NSAttributedString
[<Foundation.Register("NSMutableAttributedString", true)>]
type NSMutableAttributedString = class
    inherit NSAttributedString
继承
NSMutableAttributedString
派生
特性

构造函数

名称 说明
NSMutableAttributedString()

NSMutableAttributedString使用默认值创建新项。

NSMutableAttributedString(NativeHandle)

创建非托管对象的托管表示形式时使用的构造函数。 由运行时调用。

NSMutableAttributedString(NSAttributedString)
NSMutableAttributedString(NSCoder)

一个构造函数,用于从存储在 unarchiver 对象中的数据初始化对象。

NSMutableAttributedString(NSObjectFlag)

要调用派生类的构造函数,以跳过初始化,并仅分配对象。

NSMutableAttributedString(String, CTStringAttributes)

从 C# 字符串创建 NSMutableAttributedString,并将指定的 CoreText 属性应用于整个字符串。

NSMutableAttributedString(String, NSDictionary)
NSMutableAttributedString(String, UIFont, UIColor, UIColor, UIColor, NSParagraphStyle, NSLigatureType, Single, NSUnderlineStyle, NSShadow, Single, NSUnderlineStyle)

从具有单个 UIKit 样式属性的字符串创建 NSMutableAttributedString。

NSMutableAttributedString(String, UIStringAttributes)

使用 UIKit 属性从字符串创建 NSMutableAttributedString。

NSMutableAttributedString(String)

属性

名称 说明
AccessibilityAttributedUserInputLabels (继承自 NSObject)
AccessibilityRespondsToUserInteraction (继承自 NSObject)
AccessibilityTextualContext (继承自 NSObject)
AccessibilityUserInputLabels (继承自 NSObject)
AttributedStringByInflectingString (继承自 NSAttributedString)
Class (继承自 NSObject)
ClassHandle

此类的 Objective-C 类句柄。

ContainsAttachments (继承自 NSAttributedString)
DebugDescription (继承自 NSObject)
Description (继承自 NSObject)
ExposedBindings (继承自 NSObject)
Handle

处理(指针)到非托管对象表示形式。

(继承自 NSObject)
IsDirectBinding

获取或设置一个值,该值指示此实例是否使用直接 Objective-C 绑定。

(继承自 NSObject)
IsProxy (继承自 NSObject)
Length (继承自 NSAttributedString)
LowLevelValue (继承自 NSAttributedString)
MutableString
RetainCount (继承自 NSObject)
Self (继承自 NSObject)
Size (继承自 NSAttributedString)
Superclass (继承自 NSObject)
SuperHandle
已过时.

用于表示此 NSObject基类中方法的句柄。

(继承自 NSObject)
Value

作为字符串的对象的内容。

(继承自 NSAttributedString)
WritableTypeIdentifiersForItemProvider (继承自 NSAttributedString)
Zone (继承自 NSObject)

方法

名称 说明
AddAttribute(NSString, NSObject, NSRange)
AddAttributes(CTStringAttributes, NSRange)

将属性添加到字符串中的指定字符范围。

AddAttributes(NSDictionary, NSRange)
AddAttributes(NSStringAttributes, NSRange)
AddAttributes(UIStringAttributes, NSRange)

将属性添加到字符串中的指定字符范围。

AddObserver(NSObject, NSString, NSKeyValueObservingOptions, IntPtr) (继承自 NSObject)
AddObserver(NSObject, String, NSKeyValueObservingOptions, IntPtr) (继承自 NSObject)
AddObserver(NSString, NSKeyValueObservingOptions, Action<NSObservedChange>)

注册对象以使用任意方法在外部观察。

(继承自 NSObject)
AddObserver(String, NSKeyValueObservingOptions, Action<NSObservedChange>)

注册对象以使用任意方法在外部观察。

(继承自 NSObject)
Append(NSAttributedString, Object[])

将特性化字符串和其他对象追加到接收方末尾。

Append(NSAttributedString)
AwakeFromNib() (继承自 NSObject)
BeginEditing()
BeginInvokeOnMainThread(Action)

在主 UI 线程上异步调用指定的操作。

(继承自 NSObject)
BeginInvokeOnMainThread(Selector, NSObject)

在主 UI 线程上异步调用指定的代码。

(继承自 NSObject)
Bind(NSString, NSObject, String, NSBindingOptions) (继承自 NSObject)
Bind(NSString, NSObject, String, NSDictionary) (继承自 NSObject)
BoundingRectWithSize(CGSize, NSStringDrawingOptions) (继承自 NSAttributedString)
CommitEditing() (继承自 NSObject)
CommitEditing(NSObject, Selector, IntPtr) (继承自 NSObject)
ConformsToProtocol(NativeHandle) (继承自 NSObject)
ContainsAttachmentsInRange(NSRange) (继承自 NSAttributedString)
Copy() (继承自 NSObject)
Copy(NSZone)

执行基础 Objective-C 对象的副本。

(继承自 NSAttributedString)
DangerousAutorelease()

对此对象调用“autorelease”选择器。

(继承自 NSObject)
DangerousRelease()

对此对象调用“release”选择器。

(继承自 NSObject)
DangerousRetain()

对此对象调用“保留”选择器。

(继承自 NSObject)
DeleteRange(NSRange)
DidChange(NSKeyValueChange, NSIndexSet, NSString) (继承自 NSObject)
DidChange(NSString, NSKeyValueSetMutationKind, NSSet) (继承自 NSObject)
DidChangeValue(String) (继承自 NSObject)
Dispose()

释放对象使用 NSObject 的资源。

(继承自 NSObject)
Dispose(Boolean)

释放此对象使用的资源。

(继承自 NSObject)
DoesNotRecognizeSelector(Selector) (继承自 NSObject)
DoubleClick(UIntPtr) (继承自 NSAttributedString)
DrawString(CGPoint)

绘制指定点处的字符串。

(继承自 NSAttributedString)
DrawString(CGRect, NSStringDrawingOptions, NSStringDrawingContext) (继承自 NSAttributedString)
DrawString(CGRect, NSStringDrawingOptions) (继承自 NSAttributedString)
DrawString(CGRect) (继承自 NSAttributedString)
EncodeTo(NSCoder)

使用提供的编码器对对象的状态进行编码。

(继承自 NSAttributedString)
EndEditing()
EnumerateAttribute(NSString, NSRange, NSAttributedStringEnumeration, NSAttributedStringCallback) (继承自 NSAttributedString)
EnumerateAttributes(NSRange, NSAttributedStringEnumeration, NSAttributedRangeCallback) (继承自 NSAttributedString)
Equals(NSObject)

确定指定的 NSObject 值是否等于当前 NSObject。

(继承自 NSObject)
Equals(Object)

确定指定的对象是否等于当前 NSObject对象。

(继承自 NSObject)
GetAppKitAttributes(IntPtr, NSRange, NSRange)

返回位于给定范围限制内指定位置的 AppKit 字符串属性。

(继承自 NSAttributedString)
GetAppKitAttributes(IntPtr, NSRange)

返回位于指定位置的 AppKit 字符串属性。

(继承自 NSAttributedString)
GetAttribute(String, IntPtr, NSRange, NSRange) (继承自 NSAttributedString)
GetAttribute(String, IntPtr, NSRange) (继承自 NSAttributedString)
GetAttributes(IntPtr, NSRange, NSRange) (继承自 NSAttributedString)
GetAttributes(IntPtr, NSRange) (继承自 NSAttributedString)
GetBindingInfo(NSString) (继承自 NSObject)
GetBindingOptionDescriptions(NSString) (继承自 NSObject)
GetBindingValueClass(NSString) (继承自 NSObject)
GetBoundingRect(CGSize, NSStringDrawingOptions, NSStringDrawingContext) (继承自 NSAttributedString)
GetCoreTextAttributes(IntPtr, NSRange, NSRange) (继承自 NSAttributedString)
GetCoreTextAttributes(IntPtr, NSRange) (继承自 NSAttributedString)
GetData(NSRange, NSAttributedStringDocumentAttributes, NSError) (继承自 NSAttributedString)
GetData(NSRange, NSDictionary, NSError) (继承自 NSAttributedString)
GetDataFromRange(NSRange, NSAttributedStringDocumentAttributes, NSError)
已过时.
(继承自 NSAttributedString)
GetDataFromRange(NSRange, NSDictionary, NSError)
已过时.
(继承自 NSAttributedString)
GetDictionaryOfValuesFromKeys(NSString[]) (继承自 NSObject)
GetDocFormat(NSRange, NSAttributedStringDocumentAttributes) (继承自 NSAttributedString)
GetDocFormat(NSRange, NSDictionary) (继承自 NSAttributedString)
GetFileWrapper(NSRange, NSAttributedStringDocumentAttributes, NSError) (继承自 NSAttributedString)
GetFileWrapper(NSRange, NSDictionary, NSError) (继承自 NSAttributedString)
GetFileWrapperFromRange(NSRange, NSAttributedStringDocumentAttributes, NSError)
已过时.
(继承自 NSAttributedString)
GetFileWrapperFromRange(NSRange, NSDictionary, NSError)
已过时.
(继承自 NSAttributedString)
GetFontAttributes(NSRange) (继承自 NSAttributedString)
GetHashCode()

为当前实例生成哈希代码。

(继承自 NSObject)
GetItemNumber(NSTextList, UIntPtr) (继承自 NSAttributedString)
GetItemProviderVisibilityForTypeIdentifier(String) (继承自 NSAttributedString)
GetLineBreak(UIntPtr, NSRange) (继承自 NSAttributedString)
GetLineBreakByHyphenating(UIntPtr, NSRange) (继承自 NSAttributedString)
GetMethodForSelector(Selector) (继承自 NSObject)
GetNativeHash() (继承自 NSObject)
GetNextWord(UIntPtr, Boolean) (继承自 NSAttributedString)
GetPasteboardPropertyListForType(String) (继承自 NSAttributedString)
GetRange(NSTextBlock, UIntPtr) (继承自 NSAttributedString)
GetRange(NSTextList, UIntPtr) (继承自 NSAttributedString)
GetRange(NSTextTable, UIntPtr) (继承自 NSAttributedString)
GetRtf(NSRange, NSAttributedStringDocumentAttributes) (继承自 NSAttributedString)
GetRtf(NSRange, NSDictionary) (继承自 NSAttributedString)
GetRtfd(NSRange, NSAttributedStringDocumentAttributes) (继承自 NSAttributedString)
GetRtfd(NSRange, NSDictionary) (继承自 NSAttributedString)
GetRtfdFileWrapper(NSRange, NSAttributedStringDocumentAttributes) (继承自 NSAttributedString)
GetRtfdFileWrapper(NSRange, NSDictionary) (继承自 NSAttributedString)
GetRulerAttributes(NSRange) (继承自 NSAttributedString)
GetUIKitAttributes(IntPtr, NSRange, NSRange) (继承自 NSAttributedString)
GetUIKitAttributes(IntPtr, NSRange) (继承自 NSAttributedString)
GetUrl(UIntPtr, NSRange) (继承自 NSAttributedString)
GetWritableTypesForPasteboard(NSPasteboard) (继承自 NSAttributedString)
GetWritingOptionsForType(String, NSPasteboard) (继承自 NSAttributedString)
Init()

通过调用 Objective-C init 方法初始化对象。

(继承自 NSObject)
InitializeHandle(NativeHandle, String, Boolean)

Handle使用本机初始值设定项的结果初始化属性。

(继承自 NSObject)
InitializeHandle(NativeHandle, String) (继承自 NSObject)
InitializeHandle(NativeHandle) (继承自 NSObject)
Insert(NSAttributedString, IntPtr)

将特性化字符串插入当前字符串。

Invoke(Action, Double)

在指定的延迟后调用指定的操作。

(继承自 NSObject)
Invoke(Action, TimeSpan)

在指定的延迟后调用指定的操作。

(继承自 NSObject)
InvokeOnMainThread(Action)

在主 UI 线程上同步调用指定的操作。

(继承自 NSObject)
InvokeOnMainThread(Selector, NSObject)

在主 UI 线程上同步调用指定的代码。

(继承自 NSObject)
IsEqual(NSAttributedString) (继承自 NSAttributedString)
IsEqual(NSObject) (继承自 NSObject)
IsKindOfClass(Class) (继承自 NSObject)
IsMemberOfClass(Class) (继承自 NSObject)
LoadData(String, Action<NSData,NSError>)

实现此方法以自定义数据加载方式 NSItemProvider。

(继承自 NSAttributedString)
LoadDataAsync(String, NSProgress) (继承自 NSAttributedString)
LoadDataAsync(String)

从项提供程序异步加载标识类型的数据,并返回包含数据的任务。

(继承自 NSAttributedString)
LowLevelGetAttributes(IntPtr, IntPtr) (继承自 NSAttributedString)
LowLevelGetAttributes(IntPtr, NSRange)

低级别版本,为指定范围内的属性提供 NSDictionary。

(继承自 NSAttributedString)
LowLevelSetAttributes(IntPtr, NSRange)
MarkDirty()

将常规对等对象(IsDirectBinding 为 true)提升为 toggleref 对象。

(继承自 NSObject)
MutableCopy() (继承自 NSObject)
MutableCopy(NSZone) (继承自 NSAttributedString)
ObjectDidEndEditing(NSObject) (继承自 NSObject)
ObserveValue(NSString, NSObject, NSDictionary, IntPtr) (继承自 NSObject)
PerformSelector(Selector, NSObject, Double, NSString[]) (继承自 NSObject)
PerformSelector(Selector, NSObject, Double) (继承自 NSObject)
PerformSelector(Selector, NSObject, NSObject) (继承自 NSObject)
PerformSelector(Selector, NSObject) (继承自 NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean, NSString[]) (继承自 NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean) (继承自 NSObject)
PerformSelector(Selector) (继承自 NSObject)
PrefersRtfdInRange(NSRange) (继承自 NSAttributedString)
PrepareForInterfaceBuilder() (继承自 NSObject)
ReadFromData(NSData, NSAttributedStringDocumentAttributes, NSDictionary, NSError)
ReadFromData(NSData, NSDictionary, NSDictionary, NSError)
ReadFromFile(NSUrl, NSAttributedStringDocumentAttributes, NSDictionary, NSError)

开发人员不应使用此弃用的方法。 开发人员应改用“ReadFromUrl”。

ReadFromFile(NSUrl, NSDictionary, NSDictionary, NSError)
ReadFromUrl(NSUrl, NSAttributedStringDocumentAttributes, NSDictionary<NSString,NSObject>, NSError)
ReadFromUrl(NSUrl, NSDictionary<NSString,NSObject>, NSDictionary<NSString,NSObject>, NSError)
RemoveAttribute(String, NSRange)
RemoveObserver(NSObject, NSString, IntPtr) (继承自 NSObject)
RemoveObserver(NSObject, NSString) (继承自 NSObject)
RemoveObserver(NSObject, String, IntPtr) (继承自 NSObject)
RemoveObserver(NSObject, String) (继承自 NSObject)
Replace(NSRange, NSAttributedString)
Replace(NSRange, String)
RespondsToSelector(Selector) (继承自 NSObject)
SetAttributes(CTStringAttributes, NSRange)

设置指定区域的属性。 该区域中的任何以前的属性都替换为新值。

SetAttributes(NSDictionary, NSRange)

设置指定区域的属性。 该区域中的任何以前的属性都替换为新值。

SetAttributes(UIStringAttributes, NSRange)

设置指定区域的属性。 该区域中的任何以前的属性都替换为新值。

SetNilValueForKey(NSString) (继承自 NSObject)
SetString(NSAttributedString)
SetValueForKey(NSObject, NSString) (继承自 NSObject)
SetValueForKeyPath(NativeHandle, NSString)

将给定键路径标识的属性的值设置为给定值。

(继承自 NSObject)
SetValueForKeyPath(NSObject, NSString) (继承自 NSObject)
SetValueForUndefinedKey(NSObject, NSString) (继承自 NSObject)
SetValuesForKeysWithDictionary(NSDictionary) (继承自 NSObject)
Substring(IntPtr, IntPtr) (继承自 NSAttributedString)
ToString()

返回当前实例值的字符串表示形式。

(继承自 NSObject)
Unbind(NSString) (继承自 NSObject)
ValueForKey(NSString) (继承自 NSObject)
ValueForKeyPath(NSString) (继承自 NSObject)
ValueForUndefinedKey(NSString) (继承自 NSObject)
WillChange(NSKeyValueChange, NSIndexSet, NSString) (继承自 NSObject)
WillChange(NSString, NSKeyValueSetMutationKind, NSSet) (继承自 NSObject)
WillChangeValue(String) (继承自 NSObject)

扩展方法

名称 说明
AcceptsPreviewPanelControl(NSObject, QLPreviewPanel)
AccessibilityHitTest(NSObject, CGPoint, UIEvent)
ApplyFontTraits(NSMutableAttributedString, NSFontTraitMask, NSRange)
BeginPreviewPanelControl(NSObject, QLPreviewPanel)
BoundingRectWithSize(NSAttributedString, CGSize, NSStringDrawingOptions, NSStringDrawingContext)
BrowserAccessibilityDeleteTextAtCursor(NSObject, IntPtr)
BrowserAccessibilityInsertTextAtCursor(NSObject, String)
ContainsAttachments(NSAttributedString, NSRange)

返回 true 当前 NSAttributedString 是否包含指定 range中的附件。

DrawAtPoint(NSAttributedString, CGPoint)
DrawInRect(NSAttributedString, CGRect)
DrawWithRect(NSAttributedString, CGRect, NSStringDrawingOptions, NSStringDrawingContext)
EndPreviewPanelControl(NSObject, QLPreviewPanel)
FixAttachmentAttributeInRange(NSMutableAttributedString, NSRange)
FixAttributesInRange(NSMutableAttributedString, NSRange)

清理可在许多编辑中累积的不一致。

FixFontAttributeInRange(NSMutableAttributedString, NSRange)
FixParagraphStyleAttributeInRange(NSMutableAttributedString, NSRange)
GetAccessibilityCustomRotors(NSObject)

获取适合UIAccessibilityCustomRotor对象的对象的数组this。

GetAccessibilityLineEndPositionFromCurrentSelection(NSObject)
GetAccessibilityLineRangeForPosition(NSObject, IntPtr)
GetAccessibilityLineStartPositionFromCurrentSelection(NSObject)
GetAccessibilityNextTextNavigationElement(NSObject)
GetAccessibilityNextTextNavigationElementBlock(NSObject)
GetAccessibilityPreviousTextNavigationElement(NSObject)
GetAccessibilityPreviousTextNavigationElementBlock(NSObject)
GetAccessibilityTextInputResponder(NSObject)
GetAccessibilityTextInputResponderHandler(NSObject)
GetBrowserAccessibilityAttributedValue(NSObject, NSRange)
GetBrowserAccessibilityContainerType(NSObject)
GetBrowserAccessibilityCurrentStatus(NSObject)
GetBrowserAccessibilityDetailsElements(NSObject)
GetBrowserAccessibilityHasDomFocus(NSObject)
GetBrowserAccessibilityImageData(NSObject, NSDictionary)
GetBrowserAccessibilityImageDataSize(NSObject)
GetBrowserAccessibilityIsRequired(NSObject)
GetBrowserAccessibilityKeyboardShortcuts(NSObject)
GetBrowserAccessibilityOrientation(NSObject)
GetBrowserAccessibilityPressedState(NSObject)
GetBrowserAccessibilityRoleDescription(NSObject)
GetBrowserAccessibilitySelectedTextRange(NSObject)
GetBrowserAccessibilitySortDirection(NSObject)
GetBrowserAccessibilityValue(NSObject, NSRange)
GetDebugDescription(INSObjectProtocol)
GetHandle(INativeObject)
GetItemProviderVisibilityForTypeIdentifier(INSItemProviderWriting, String)
GetNonNullHandle(INativeObject, String)
GetSize(NSAttributedString)
GetValidModes(NSObject, NSFontPanel)
GetWritableTypeIdentifiersForItemProvider(INSItemProviderWriting)
GetWritingOptionsForType(INSPasteboardWriting, String, NSPasteboard)
LoadDataAsync(INSItemProviderWriting, String, NSProgress)
LoadDataAsync(INSItemProviderWriting, String)

从项提供程序异步加载标识类型的数据,并返回包含数据的任务。

ObjectDidBeginEditing(NSObject, INSEditor)
ObjectDidEndEditing(NSObject, INSEditor)
ProvideImageData(NSObject, IntPtr, UIntPtr, UIntPtr, UIntPtr, UIntPtr, UIntPtr, NSObject)
ProvideImageToMTLTexture(NSObject, IMTLTexture, IMTLCommandBuffer, UIntPtr, UIntPtr, UIntPtr, UIntPtr, NSObject)
ReadFromData(NSMutableAttributedString, NSData, NSAttributedStringDocumentAttributes, NSDictionary, NSError)
ReadFromData(NSMutableAttributedString, NSData, NSAttributedStringDocumentAttributes, NSDictionary)
ReadFromData(NSMutableAttributedString, NSData, NSDictionary, NSDictionary, NSError)
ReadFromData(NSMutableAttributedString, NSData, NSDictionary, NSDictionary)
ReadFromURL(NSMutableAttributedString, NSUrl, NSAttributedStringDocumentAttributes, NSDictionary, NSError)
ReadFromURL(NSMutableAttributedString, NSUrl, NSAttributedStringDocumentAttributes, NSDictionary)
ReadFromURL(NSMutableAttributedString, NSUrl, NSDictionary, NSDictionary, NSError)
ReadFromURL(NSMutableAttributedString, NSUrl, NSDictionary, NSDictionary)
SetAccessibilityCustomRotors(NSObject, UIAccessibilityCustomRotor[])

设置适合UIAccessibilityCustomRotor对象的对象的数组this。

SetAccessibilityNextTextNavigationElement(NSObject, NSObject)
SetAccessibilityNextTextNavigationElementBlock(NSObject, AXObjectReturnBlock)
SetAccessibilityPreviousTextNavigationElement(NSObject, NSObject)
SetAccessibilityPreviousTextNavigationElementBlock(NSObject, AXObjectReturnBlock)
SetAccessibilityTextInputResponder(NSObject, IUITextInput)
SetAccessibilityTextInputResponderHandler(NSObject, UITextInputReturnHandler)
SetAlignment(NSMutableAttributedString, NSTextAlignment, NSRange)
SetBaseWritingDirection(NSMutableAttributedString, NSWritingDirection, NSRange)
SetBrowserAccessibilityContainerType(NSObject, BEAccessibilityContainerType)
SetBrowserAccessibilityCurrentStatus(NSObject, String)
SetBrowserAccessibilityDetailsElements(NSObject, NSObject[])
SetBrowserAccessibilityHasDomFocus(NSObject, Boolean)
SetBrowserAccessibilityIsRequired(NSObject, Boolean)
SetBrowserAccessibilityKeyboardShortcuts(NSObject, String)
SetBrowserAccessibilityOrientation(NSObject, BEAccessibilityOrientation)
SetBrowserAccessibilityPressedState(NSObject, BEAccessibilityPressedState)
SetBrowserAccessibilityRoleDescription(NSObject, String)
SetBrowserAccessibilitySelectedTextRange(NSObject, NSRange)
SetBrowserAccessibilitySortDirection(NSObject, String)
SetSharedObservers(NSObject, NSKeyValueSharedObserversSnapshot)
SubscriptRange(NSMutableAttributedString, NSRange)
SuperscriptRange(NSMutableAttributedString, NSRange)
UnscriptRange(NSMutableAttributedString, NSRange)
UpdateAttachmentsFromPath(NSMutableAttributedString, String)
ValidateToolbarItem(NSObject, NSToolbarItem)

适用于