Most visited

Recently visited

Added in API level 17

LocaleSpan

public class LocaleSpan
extends MetricAffectingSpan implements ParcelableSpan

java.lang.Object
    android.text.style.CharacterStyle
      android.text.style.MetricAffectingSpan
        android.text.style.LocaleSpan


更改跨度所附文本的 Locale

摘要(Summary)

Inherited constants

From interface android.os.Parcelable

Public constructors

LocaleSpan(Locale locale)

创建 LocaleSpan从井中形成 Locale

LocaleSpan(LocaleList locales)

创建 LocaleSpanLocaleList

LocaleSpan(Parcel source)

公共方法(Public methods)

int describeContents()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。

Locale getLocale()
LocaleList getLocales()
int getSpanTypeId()

返回此跨度类的特殊类型标识符。

void updateDrawState(TextPaint ds)
void updateMeasureState(TextPaint paint)
void writeToParcel(Parcel dest, int flags)

将此对象平铺到一个包裹中。

继承方法(Inherited methods)

From class android.text.style.MetricAffectingSpan
From class android.text.style.CharacterStyle
From class java.lang.Object
From interface android.text.ParcelableSpan
From interface android.os.Parcelable

Public constructors

LocaleSpan

Added in API level 17
LocaleSpan (Locale locale)

创建LocaleSpan从井中形成Locale 请注意,只有Locale可以通过以下方式创建对象forLanguageTag(String)的支持。

警告:不要指定任何Locale不能由创建对象forLanguageTag(String) new Locale(" a ", " b c", " d")是这种格式不正确的Locale对象的示例。

参数(Parameters)
locale Locale: The Locale of the text to which the span is attached.

也可以看看:

LocaleSpan

Added in API level 24
LocaleSpan (LocaleList locales)

创建 LocaleSpanLocaleList

参数(Parameters)
locales LocaleList: The LocaleList of the text to which the span is attached.
抛出异常(Throws)
NullPointerException if locales is null

LocaleSpan

Added in API level 17
LocaleSpan (Parcel source)

参数(Parameters)
source Parcel

公共方法(Public methods)

describeContents

Added in API level 17
int describeContents ()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。

返回(Returns)
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getLocale

Added in API level 17
Locale getLocale ()

返回(Returns)
Locale The Locale for this span. If multiple locales are associated with this span, only the first locale is returned. null if no Locale is specified.

也可以看看:

getLocales

Added in API level 24
LocaleList getLocales ()

返回(Returns)
LocaleList The entire list of locales that are associated with this span.

getSpanTypeId

Added in API level 17
int getSpanTypeId ()

Return a special type identifier for this span class.

返回(Returns)
int

updateDrawState

Added in API level 17
void updateDrawState (TextPaint ds)

参数(Parameters)
ds TextPaint

updateMeasureState

Added in API level 17
void updateMeasureState (TextPaint paint)

参数(Parameters)
paint TextPaint

writeToParcel

Added in API level 17
void writeToParcel (Parcel dest, 
                int flags)

将此对象平铺到一个包裹中。

参数(Parameters)
dest Parcel: The Parcel in which the object should be written.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Hooray!