WebView 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| WebView(Context) |
建立一個新的 WebView,並附帶活動上下文物件。 |
| WebView(Context, IAttributeSet) |
建立一個帶有版面參數的新 WebView。 |
| WebView(IntPtr, JniHandleOwnership) |
用於建立 JNI 物件受管理表示的建構器;由執行時呼叫。 |
| WebView(Context, IAttributeSet, Int32) |
建立一個新的 WebView,包含版面參數和預設樣式。 |
| WebView(Context, IAttributeSet, Int32, Boolean) |
已淘汰.
建立一個新的 WebView,包含版面參數和預設樣式。 |
| WebView(Context, IAttributeSet, Int32, Int32) |
建立一個新的 WebView,包含版面參數和預設樣式。 |
WebView(Context)
建立一個新的 WebView,並附帶活動上下文物件。
[Android.Runtime.Register(".ctor", "(Landroid/content/Context;)V", "")]
public WebView(Android.Content.Context context);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;)V", "")>]
new Android.Webkit.WebView : Android.Content.Context -> Android.Webkit.WebView
參數
- context
- Context
一個用來存取應用程式資產的活動上下文
- 屬性
備註
建立一個新的 WebView,並附帶活動上下文物件。
<b>注意:</b> WebView 應始終以活動上下文實例化。 若以應用程式上下文實例化,WebView 將無法提供多項功能,如 JavaScript 對話框與自動填充。
Java 文件 android.webkit.WebView.WebView(android.content.Context)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
WebView(Context, IAttributeSet)
建立一個帶有版面參數的新 WebView。
[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "")]
public WebView(Android.Content.Context context, Android.Util.IAttributeSet? attrs);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;)V", "")>]
new Android.Webkit.WebView : Android.Content.Context * Android.Util.IAttributeSet -> Android.Webkit.WebView
參數
- context
- Context
一個用來存取應用程式資產的活動上下文
- attrs
- IAttributeSet
一個傳給父節點的屬性集合
- 屬性
備註
建立一個帶有版面參數的新 WebView。
Java 文件 android.webkit.WebView.WebView(android.content.Context, android.util.AttributeSet)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
WebView(IntPtr, JniHandleOwnership)
用於建立 JNI 物件受管理表示的建構器;由執行時呼叫。
protected WebView(IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Webkit.WebView : nativeint * Android.Runtime.JniHandleOwnership -> Android.Webkit.WebView
參數
- transfer
- JniHandleOwnership
JniHandleOwnershipA 指示如何處理javaReference
備註
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
WebView(Context, IAttributeSet, Int32)
建立一個新的 WebView,包含版面參數和預設樣式。
[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "")]
public WebView(Android.Content.Context context, Android.Util.IAttributeSet? attrs, int defStyleAttr);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;I)V", "")>]
new Android.Webkit.WebView : Android.Content.Context * Android.Util.IAttributeSet * int -> Android.Webkit.WebView
參數
- context
- Context
一個用來存取應用程式資產的活動上下文
- attrs
- IAttributeSet
一個傳給父節點的屬性集合
- defStyleAttr
- Int32
目前主題中的一個屬性,包含對提供視圖預設值的樣式資源的參考。 可以是0,不用找預設值。
- 屬性
備註
建立一個新的 WebView,包含版面參數和預設樣式。
Java 文件 android.webkit.WebView.WebView(android.content.Context, android.util.AttributeSet, int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
WebView(Context, IAttributeSet, Int32, Boolean)
警告
deprecated
建立一個新的 WebView,包含版面參數和預設樣式。
[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;IZ)V", "")]
[System.Obsolete("deprecated")]
public WebView(Android.Content.Context context, Android.Util.IAttributeSet? attrs, int defStyleAttr, bool privateBrowsing);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;IZ)V", "")>]
[<System.Obsolete("deprecated")>]
new Android.Webkit.WebView : Android.Content.Context * Android.Util.IAttributeSet * int * bool -> Android.Webkit.WebView
參數
- context
- Context
一個用來存取應用程式資產的活動上下文
- attrs
- IAttributeSet
一個傳給父節點的屬性集合
- defStyleAttr
- Int32
目前主題中的一個屬性,包含對提供視圖預設值的樣式資源的參考。 可以是0,不用找預設值。
- privateBrowsing
- Boolean
此 WebView 是否會以私有模式初始化
- 屬性
備註
建立一個新的 WebView,包含版面參數和預設樣式。
此會員已被棄用。 WebView 不再直接支援私人瀏覽功能,未來版本將移除。 偏好使用 WebSettings、 WebViewDatabase、 CookieManagerWebStorage 來細緻控制隱私資料。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
WebView(Context, IAttributeSet, Int32, Int32)
建立一個新的 WebView,包含版面參數和預設樣式。
[Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;II)V", "")]
public WebView(Android.Content.Context context, Android.Util.IAttributeSet? attrs, int defStyleAttr, int defStyleRes);
[<Android.Runtime.Register(".ctor", "(Landroid/content/Context;Landroid/util/AttributeSet;II)V", "")>]
new Android.Webkit.WebView : Android.Content.Context * Android.Util.IAttributeSet * int * int -> Android.Webkit.WebView
參數
- context
- Context
一個用來存取應用程式資產的活動上下文
- attrs
- IAttributeSet
一個傳給父節點的屬性集合
- defStyleAttr
- Int32
目前主題中的一個屬性,包含對提供視圖預設值的樣式資源的參考。 可以是0,不用找預設值。
- defStyleRes
- Int32
一種樣式資源的資源識別碼,提供該視圖的預設值,僅在 defStyleAttr 為 0 或在主題中找不到時使用。 可以是0,不用找預設值。
- 屬性
備註
建立一個新的 WebView,包含版面參數和預設樣式。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。