語言

RemoteViews 類別

定義

一個描述可於其他程序中顯示的視圖階層的類別。

[Android.Runtime.Register("android/widget/RemoteViews", DoNotGenerateAcw=true)]
public class RemoteViews : Java.Lang.Object, Android.OS.IParcelable, Android.Views.LayoutInflater.IFilter, IDisposable
[<Android.Runtime.Register("android/widget/RemoteViews", DoNotGenerateAcw=true)>]
type RemoteViews = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface LayoutInflater.IFilter
繼承
RemoteViews
屬性
實作

備註

一個描述可於其他程序中顯示的視圖階層的類別。 階層結構是從版面資源檔案膨脹而來,這個類別提供一些基本操作來修改膨脹階層的內容。

RemoteViews 僅限於支援以下配置:

<烏爾>·李<>android.widget.AdapterViewFlipper/李<>李<>android.widget.FrameLayout/李<><>android.widget.GridLayout李/李<><>android.widget.GridView李/李<><>android.widget.LinearLayout李/李<><>android.widget.ListView<><>android.widget.RelativeLayout<><>android.widget.StackView<><>android.widget.ViewFlipper<>李烏爾<>

以及以下的小工具:

<烏爾>·李<>android.widget.AnalogClock/李<>李<>android.widget.Button/李<><>android.widget.Chronometer李/李<><>android.widget.ImageButton李/李李/李<><>android.widget.ImageView/李<><>android.widget.ProgressBar<><>android.widget.TextClock/李<><>android.widget.TextView李/UL<><>

自 API 31 起,以下元件與版面配置也可使用:

<烏爾><李>android.widget.CheckBox</李><李>android.widget.RadioButton</李><李>android.widget.RadioGroup</李/李><>android.widget.Switch<李/烏爾><>

這些階級的後代不被支持。

Java 文件 android.widget.RemoteViews

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

建構函式

名稱 Description
RemoteViews(IDictionary<SizeF,RemoteViews>)

建立一個新的 RemoteViews 物件,將版面膨脹為最接近的尺寸規格。

RemoteViews(IntPtr, JniHandleOwnership)

用於建立 JNI 物件受管理表示的建構器;由執行時呼叫。

RemoteViews(Parcel)

讀取 Remote Views 物件,從 parcel 中讀取。

RemoteViews(RemoteViews, RemoteViews)

建立一個新的 RemoteViews 物件,根據目前的配置,該物件會膨脹成指定的陸地空間或直向 RemoteViews。

RemoteViews(RemoteViews)

建立另一個 RemoteViews 的副本。

RemoteViews(RemoteViews+DrawInstructions)

建立 RemoteViews 一個從繪圖開始的指令。

RemoteViews(String, Int32, Int32)

建立一個新的 RemoteViews 物件,顯示指定版面檔案中的視圖,並將根視圖的 ID 改為指定的。

RemoteViews(String, Int32)

建立一個新的 RemoteViews 物件,顯示指定版面檔案中所包含的視圖。

欄位

名稱 Description
ExtraChecked

意圖額外用於檢查已檢查狀態變更的視圖是否目前被檢查。

ExtraSharedElementBounds

包含所有共享元素界限的意圖額外。

MarginBottom
已淘汰.

這個數值會套用到marginBottom。

MarginEnd
已淘汰.

這個值會套用到marginEnd。

MarginLeft
已淘汰.

該值將套用到marginLeft。

MarginRight
已淘汰.

這個數值會應用在邊界右邊。

MarginStart
已淘汰.

這個值會套用到 marginStart。

MarginTop
已淘汰.

這個數值會套用到 marginTop。

屬性

名稱 Description
Class

回傳此 Object的執行時類別。

(繼承來源 Object)
Creator

可包裹。

Handle

底層 Android 實例的帳號。

(繼承來源 Object)
JniIdentityHashCode

取得由互通執行時指派給此 Java 對等端的身份雜湊碼。

(繼承來源 Object)
JniManagedPeerState

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
JniPeerMembers

取得此受管理綁定類型的 JNI 同儕成員元資料。

LayoutId

回傳與此 RemoteView 相關的根版面配置的 layout ID。

Package

拿包裹。

PeerReference

取得這個 Java 節點的 JNI 物件參考。

(繼承來源 Object)
ThresholdClass

此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。

ThresholdType

此 API 支援 Mono for Android 基礎架構,並非直接從你的程式碼中使用。

ViewId

如果使用 RemoteViews#RemoteViews(String, int, int)

方法

名稱 Description
AddStableView(Int32, RemoteViews, Int32)

等同於在膨脹給定ViewGroup#addView(View)的 後叫停RemoteViews

AddView(Int32, RemoteViews)

等同於在膨脹給定ViewGroup#addView(View)的 後叫停RemoteViews

Apply(Context, ViewGroup)

膨脹由此物件所代表的視圖階層,並套用所有動作。

Clone()

回傳 RemoteViews 物件的深度副本。

Construct(JniObjectReference, JniObjectReferenceOptions)

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
DescribeContents()

描述此 Parcelable 的組建表示中包含的特殊物件種類。

Dispose()

釋放該 Java 節點所持有的資源。

(繼承來源 Object)
Dispose(Boolean)

釋放該 Java 節點所持有的資源。

(繼承來源 Object)
DisposeUnlessReferenced()

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
Equals(Object)

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
Equals(Object)

表示是否有其他物體「等同」於此物。

(繼承來源 Object)
GetHashCode()

回傳物件的雜湊碼值。

(繼承來源 Object)
JavaFinalize()

當垃圾回收判定該物件不再有相關參考時,由垃圾回收器呼叫。

(繼承來源 Object)
Notify()

喚醒一個正在該物件監視器上等待的執行緒。

(繼承來源 Object)
NotifyAll()

喚醒所有等待該物件監視器的執行緒。

(繼承來源 Object)
OnLoadClass(Class)

用來限制可能被誇大的視角

Reapply(Context, View)

將所有動作套用到所提供的視圖。

RemoveAllViews(Int32)

等同於呼叫 ViewGroup#removeAllViews()

SetAccessibilityTraversalAfter(Int32, Int32)

等同於呼叫 android.view.View#setAccessibilityTraversalAfter(int)

SetAccessibilityTraversalBefore(Int32, Int32)

等同於呼叫 android.view.View#setAccessibilityTraversalBefore(int)

SetAppWidgetEventTag(Int32, Int32)

一個描述可於其他程序中顯示的視圖階層的類別。

SetBitmap(Int32, String, Bitmap)

呼叫一個方法,在 RemoteViews 的版面中取一個位圖。

SetBlendMode(Int32, String, BlendMode)

呼叫一個方法,在 RemoteViews 的版面中取一個 BlendMode 來處理這個 RemoteViews。

SetBoolean(Int32, String, Boolean)

呼叫一個方法,在 RemoteViews 的版面中對一個視圖取一個布林值。

SetBundle(Int32, String, Bundle)

呼叫一個方法,在 RemoteViews 的版面中取一個 Bundle 來處理視圖。

SetByte(Int32, String, SByte)

呼叫一個方法,在 RemoteViews 的版面中取一個位元組。

SetChar(Int32, String, Char)

呼叫一個方法,在 RemoteViews 的版面中取一個字元。

SetCharSequence(Int32, String, ICharSequence)

呼叫一個方法,在 RemoteViews 的版面中取一個 CharSequence。

SetCharSequence(Int32, String, Int32)

呼叫一個方法,在 RemoteViews 的版面中取一個 CharSequence。

SetCharSequence(Int32, String, String)

呼叫一個方法,在 RemoteViews 的版面中取一個 CharSequence。

SetCharSequenceAttr(Int32, String, Int32)

呼叫一個方法,在 RemoteViews 的版面中取一個 CharSequence。

SetChronometer(Int32, Int64, String, Boolean)

等價於稱 Chronometer#setBase Chronometer.setBaseChronometer#setFormat Chronometer.setFormatChronometer#start Chronometer.start()Chronometer#stop Chronometer.stop()

SetChronometerCountDown(Int32, Boolean)

等同於用指定的 viewId 呼叫 Chronometer#setCountDown(boolean) Chronometer.setCountDown 計時器。

SetColor(Int32, String, Int32)

呼叫一個方法,在 RemoteViews 的版面中對一個視圖取一個整數(int),一個顏色。

SetColorAttr(Int32, String, Int32)

呼叫一個方法,在 RemoteViews 的版面中對一個視圖取一個整數(int),一個顏色。

SetColorInt(Int32, String, Int32, Int32)

呼叫一個方法,在 RemoteViews 的版面中對一個視圖取一個整數(int),一個顏色。

SetColorStateList(Int32, String, ColorStateList, ColorStateList)

呼叫一個方法,在 RemoteViews 的版面中取一個 ColorStateList 來處理。

SetColorStateList(Int32, String, ColorStateList)

呼叫一個方法,在 RemoteViews 的版面中取一個 ColorStateList 來處理。

SetColorStateList(Int32, String, Int32)

呼叫一個方法,在 RemoteViews 的版面中取一個 ColorStateList 來處理。

SetColorStateListAttr(Int32, String, Int32)

呼叫一個方法,在 RemoteViews 的版面中取一個 ColorStateList 來處理。

SetCompoundButtonChecked(Int32, Boolean)

等同於呼叫 android.widget.CompoundButton#setChecked(boolean)

SetContentDescription(Int32, ICharSequence)

等同於呼叫 View。

SetContentDescription(Int32, String)

等同於呼叫 View。

SetDisplayedChild(Int32, Int32)

等同於呼叫 AdapterViewAnimator#setDisplayedChild(int)

SetDouble(Int32, String, Double)

在 RemoteViews 的版面中呼叫一個方法,對一個視圖取一個重疊。

SetEmptyView(Int32, Int32)

等同於呼叫 AdapterView#setEmptyView(View)

SetFloat(Int32, String, Single)

呼叫一個方法,在 RemoteViews 的版面中取一個浮點數。

SetFloatDimen(Int32, String, Int32)

呼叫一個方法,在 RemoteView 的版面中對一個視圖取一個浮點數(以像素為單位)來處理。

SetFloatDimen(Int32, String, Single, Int32)

呼叫一個方法,在 RemoteView 的版面中對一個視圖取一個浮點數(以像素為單位)來處理。

SetFloatDimenAttr(Int32, String, Int32)

呼叫一個方法,在 RemoteView 的版面中對一個視圖取一個浮點數(以像素為單位)來處理。

SetHandle(IntPtr, JniHandleOwnership)

設定 Handle 屬性。

(繼承來源 Object)
SetIcon(Int32, String, Icon, Icon)

呼叫一個方法,在 RemoteViews 的版面中取一個圖示。

SetIcon(Int32, String, Icon)

呼叫一個方法,在 RemoteViews 的版面中取一個圖示。

SetImageViewBitmap(Int32, Bitmap)

等同於呼叫 ImageView#setImageBitmap(Bitmap)

SetImageViewIcon(Int32, Icon)

等同於呼叫 ImageView#setImageIcon(Icon)

SetImageViewResource(Int32, Int32)

等同於呼叫 ImageView#setImageResource(int)

SetImageViewUri(Int32, Uri)

等同於呼叫 ImageView#setImageURI(Uri)

SetInt(Int32, String, Int32)

呼叫一個方法,在 RemoteViews 的版面中對視圖取一個整數。

SetIntDimen(Int32, String, Int32)

呼叫一個方法,對 RemoteViews 的一個視圖取一個整數(像素大小)。

SetIntDimen(Int32, String, Single, Int32)

呼叫一個方法,對 RemoteViews 的一個視圖取一個整數(像素大小)。

SetIntDimenAttr(Int32, String, Int32)

呼叫一個方法,對 RemoteViews 的一個視圖取一個整數(像素大小)。

SetIntent(Int32, String, Intent)

呼叫一個方法,在 RemoteView 的版面中取一個 Intent 的視圖。

SetLabelFor(Int32, Int32)

等同於呼叫 View#setLabelFor(int)

SetLightBackgroundLayoutId(Int32)

提供替代版面 ID,可用來放大此視圖。

SetLong(Int32, String, Int64)

在 RemoteViews 的版面中呼叫一個 take one long 的視圖方法。

SetOnCheckedChangeResponse(Int32, RemoteViews+RemoteResponse)

等同於呼叫 android.widget.CompoundButton#setOnCheckedChangeListener( android.widget.CompoundButton.OnCheckedChangeListener) 以啟動提供的 RemoteResponse

SetOnClickFillInIntent(Int32, Intent)

使用集合(例如,

SetOnClickPendingIntent(Int32, PendingIntent)

等同於呼叫 android.view.View#setOnClickListener(android.view.View.OnClickListener) 以啟動提供的 PendingIntent

SetOnClickResponse(Int32, RemoteViews+RemoteResponse)

等同於打電話 android.view.View#setOnClickListener(android.view.View.OnClickListener) 以啟動提供的 RemoteResponse

SetOnStylusHandwritingPendingIntent(Int32, PendingIntent)

等同於呼叫 View.setHandwritingDelegatorCallback(Runnable)以傳送所提供的 PendingIntent 。

SetPeerReference(JniObjectReference, JniObjectReferenceOptions)

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
SetPendingIntentTemplate(Int32, PendingIntent)

使用集合(例如,

SetProgressBar(Int32, Int32, Int32, Boolean)

等價於呼叫 ProgressBar#setMax ProgressBar.setMaxProgressBar#setProgress ProgressBar.setProgressProgressBar#setIndeterminate ProgressBar.setIndeterminate

        If indeterminate is true, then the values for max and progress are ignored.
SetRadioGroupChecked(Int32, Int32)

等同於呼叫 android.widget.RadioGroup#check(int)

SetRelativeScrollPosition(Int32, Int32)

等同於呼叫 ListView#smoothScrollByOffset(int)

SetRemoteAdapter(Int32, Int32, Intent)
已淘汰.

等同於呼叫 android.widget.AbsListView#setRemoteViewsAdapter(Intent)

SetRemoteAdapter(Int32, Intent)

等同於呼叫 android.widget.AbsListView#setRemoteViewsAdapter(Intent)

SetRemoteAdapter(Int32, RemoteViews+RemoteCollectionItems)

等同於呼叫 android.widget.AbsListView#setRemoteViewsAdapter(Intent)

SetScrollPosition(Int32, Int32)

等同於呼叫 ListView#smoothScrollToPosition(int)

SetShort(Int32, String, Int16)

呼叫一個方法,在 RemoteViews 的版面中短接一個視圖。

SetString(Int32, String, String)

呼叫一個方法,在 RemoteViews 的版面中取一個字串。

SetTextColor(Int32, Color)

等同於呼叫 android.widget.TextView#setTextColor(int)

SetTextViewCompoundDrawables(Int32, Int32, Int32, Int32, Int32)

等同於呼叫 TextView#setCompoundDrawablesWithIntrinsicBounds(int, int, int, int)

SetTextViewCompoundDrawablesRelative(Int32, Int32, Int32, Int32, Int32)

等同於呼叫 TextView#setCompoundDrawablesRelativeWithIntrinsicBounds(int, int, int, int)

SetTextViewText(Int32, ICharSequence)

等同於呼叫 TextView#setText(CharSequence)

SetTextViewText(Int32, String)

等同於呼叫 TextView#setText(CharSequence)

SetTextViewTextSize(Int32, Int32, Single)

等同於呼叫 TextView#setTextSize(int, float)

SetUri(Int32, String, Uri)

呼叫一個方法,在 RemoteViews 的版面中對一個視圖取一個 Uri。

SetViewLayoutHeight(Int32, Single, Int32)

等同於設定 android.view.ViewGroup.LayoutParams#height ,但你可以以任意維度單位提供該值。

SetViewLayoutHeightAttr(Int32, Int32)

相當於 android.view.ViewGroup.LayoutParams#height 設定當前主題中該屬性的值。

SetViewLayoutHeightDimen(Int32, Int32)

等價於設定 android.view.ViewGroup.LayoutParams#height 結果為 Resources#getDimensionPixelSize(int)

SetViewLayoutMargin(Int32, Int32, Single, Int32)

等同於呼叫 MarginLayoutParams#setMarginEnd

SetViewLayoutMarginAttr(Int32, Int32, Int32)

等同於呼叫 MarginLayoutParams#setMarginEnd

SetViewLayoutMarginDimen(Int32, Int32, Int32)

等同於呼叫 MarginLayoutParams#setMarginEnd

SetViewLayoutWidth(Int32, Single, Int32)

等同於設定 android.view.ViewGroup.LayoutParams#width ,但你可以以任意維度單位提供該值。

SetViewLayoutWidthAttr(Int32, Int32)

相當於 android.view.ViewGroup.LayoutParams#width 設定當前主題中該屬性的值。

SetViewLayoutWidthDimen(Int32, Int32)

等價於設定 android.view.ViewGroup.LayoutParams#width 結果為 Resources#getDimensionPixelSize(int)

SetViewOutlinePreferredRadius(Int32, Single, Int32)

在該視圖上設定一個 OutlineProvider,其角半徑為使用 TypedValue#applyDimension(int, float, DisplayMetrics)

SetViewOutlinePreferredRadiusAttr(Int32, Int32)

在視圖上設置一個 OutlineProvider,其角半徑為 維度屬性 attrId

SetViewOutlinePreferredRadiusDimen(Int32, Int32)

在角落半徑為維度資源的視圖上設置一個 OutlineProvider,且 resId

SetViewPadding(Int32, Int32, Int32, Int32, Int32)

等同於呼叫 android.view.View#setPadding(int, int, int, int)

SetViewVisibility(Int32, ViewStates)

等同於呼叫 View#setVisibility(int)

ShowNext(Int32)

等同於呼叫 AdapterViewAnimator#showNext()

ShowPrevious(Int32)

等同於呼叫 AdapterViewAnimator#showPrevious()

ToArray<T>()

從這個 Java 陣列包裝器建立一個受管理陣列。

(繼承來源 Object)
ToString()

回傳物件的字串表示。

(繼承來源 Object)
UnregisterFromRuntime()

將此 Java 節點從互通執行時中取消註冊。

(繼承來源 Object)
Wait()

導致目前執行緒等待被喚醒,通常是透過 <em>通知</><em 或 em>中斷</em> 來喚醒。

(繼承來源 Object)
Wait(Int64, Int32)

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)
Wait(Int64)

會讓目前執行緒等待喚醒,通常是透過 <em>通知</><em 或 em>中斷</em>,或是經過一定的真實時間。

(繼承來源 Object)
WriteToParcel(Parcel, ParcelableWriteFlags)

把這個物體壓扁成一個包裹。

明確介面實作

名稱 Description
IJavaPeerable.Disposed()

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
IJavaPeerable.Finalized()

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32)

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates)

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference)

一個描述可於其他程序中顯示的視圖階層的類別。

(繼承來源 JavaObject)
IJavaPeerable.UnregisterFromRuntime()

一個描述可於其他程序中顯示的視圖階層的類別。

擴充方法

名稱 Description
GetJniTypeName(IJavaPeerable)

取得實例 self類型的 JNI 名稱。

JavaAs<TResult>(IJavaPeerable)

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

JavaCast<TResult>(IJavaObject)

執行 Android 執行時檢查型別轉換。

JavaCast<TResult>(IJavaObject)

一個描述可於其他程序中顯示的視圖階層的類別。

TryJavaCast<TResult>(IJavaPeerable, TResult)

試著強制self輸入 TResult,檢查 強制在 Java 端是否有效。

適用於