共用方式為


SpannableStringBuilder Class

Definition

This is the class for text whose content and markup can both be changed.

[Android.Runtime.Register("android/text/SpannableStringBuilder", DoNotGenerateAcw=true)]
public class SpannableStringBuilder : Java.Lang.Object, Android.Text.IEditable, IDisposable, Java.Interop.IJavaPeerable, System.Collections.Generic.IEnumerable<char>
[<Android.Runtime.Register("android/text/SpannableStringBuilder", DoNotGenerateAcw=true)>]
type SpannableStringBuilder = class
    inherit Object
    interface IEditable
    interface IGetChars
    interface ICharSequence
    interface seq<char>
    interface IEnumerable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface ISpannable
    interface ISpanned
    interface IAppendable
Inheritance
SpannableStringBuilder
Attributes
Implements

Remarks

This is the class for text whose content and markup can both be changed.

Java documentation for android.text.SpannableStringBuilder.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

SpannableStringBuilder()

Create a new SpannableStringBuilder with empty contents

SpannableStringBuilder(ICharSequence, Int32, Int32)

Create a new SpannableStringBuilder containing a copy of the specified slice of the specified text, including its spans if any.

SpannableStringBuilder(ICharSequence)

Create a new SpannableStringBuilder containing a copy of the specified text, including its spans if any.

SpannableStringBuilder(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

SpannableStringBuilder(String, Int32, Int32)

Create a new SpannableStringBuilder containing a copy of the specified slice of the specified text, including its spans if any.

SpannableStringBuilder(String)

Create a new SpannableStringBuilder containing a copy of the specified text, including its spans if any.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
TextWatcherDepth

Returns the depth of TextWatcher callbacks.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Append(Char)

Appends the character sequence text and spans what over the appended part.

Append(ICharSequence, Int32, Int32)

Appends the character sequence text and spans what over the appended part.

Append(ICharSequence, Object, SpanTypes)

Appends the character sequence text and spans what over the appended part.

Append(ICharSequence)

Appends the character sequence text and spans what over the appended part.

Append(String, Int32, Int32)

Appends the character sequence text and spans what over the appended part.

Append(String, Object, SpanTypes)

Appends the character sequence text and spans what over the appended part.

Append(String)

Appends the character sequence text and spans what over the appended part.

CharAt(Int32)

Return the char at the specified offset within the buffer.

Clear()

Convenience for replace(0, length(), "", 0, 0)

ClearSpans()

Removes all spans from the Editable, as if by calling RemoveSpan(Object) on each of them.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Delete(Int32, Int32)

Convenience for replace(st, en, "", 0, 0)

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetChars(Int32, Int32, Char[], Int32)

Copy the specified range of chars from this buffer into the specified array, beginning at the specified offset.

GetEnumerator()
GetFilters()

Returns the array of input filters that are currently applied to changes to this Editable.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetSpanEnd(Object)

Return the buffer offset of the end of the specified markup object, or -1 if it is not attached to this buffer.

GetSpanFlags(Object)

Return the flags of the end of the specified markup object, or 0 if it is not attached to this buffer.

GetSpans(Int32, Int32, Class)

Return an array of the spans of the specified type that overlap the specified range of the buffer.

GetSpanStart(Object)

Return the buffer offset of the beginning of the specified markup object, or -1 if it is not attached to this buffer.

GetTextRunCursor(Int32, Int32, Int32, Int32, Int32, Paint)
Obsolete.

Returns the next cursor position in the run.

Insert(Int32, ICharSequence, Int32, Int32)

Convenience for replace(where, where, text, start, end)

Insert(Int32, ICharSequence)

Convenience for replace(where, where, text, 0, text.length());

Insert(Int32, String, Int32, Int32)
Insert(Int32, String)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Length()

Return the number of chars in the buffer.

NextSpanTransition(Int32, Int32, Class)

Return the next offset after start but less than or equal to limit where a span of the specified type begins or ends.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
RemoveSpan(Object)

Remove the specified markup object from the buffer.

Replace(Int32, Int32, ICharSequence, Int32, Int32)

Replaces the specified range (st&hellip;en) of text in this Editable with a copy of the slice start&hellip;end from source.

Replace(Int32, Int32, ICharSequence)

Convenience for replace(st, en, text, 0, text.length())

Replace(Int32, Int32, String, Int32, Int32)
Replace(Int32, Int32, String)
SetFilters(IInputFilter[])

Sets the series of filters that will be called in succession whenever the text of this Editable is changed, each of which has the opportunity to limit or transform the text that is being inserted.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetSpan(Object, Int32, Int32, SpanTypes)

Mark the specified range of text with the specified object.

SubSequence(Int32, Int32)

Return a new CharSequence containing a copy of the specified range of this buffer, including the overlapping spans.

SubSequenceFormatted(Int32, Int32)

Return a new CharSequence containing a copy of the specified range of this buffer, including the overlapping spans.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
ValueOf(ICharSequence)
ValueOf(String)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IEnumerable.GetEnumerator()
IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

Append(IEditable, String, Int32, Int32)
Append(IEditable, String)
Insert(IEditable, Int32, String, Int32, Int32)
Insert(IEditable, Int32, String)
Replace(IEditable, Int32, Int32, String, Int32, Int32)
Replace(IEditable, Int32, Int32, String)
JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)
Append(IAppendable, String, Int32, Int32)
Append(IAppendable, String)
SubSequence(ICharSequence, Int32, Int32)

Applies to