Context.CreateConfigurationContext(Configuration) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個新的 Context 物件,針對目前的 Context,但其資源會調整以符合給定的配置。
[Android.Runtime.Register("createConfigurationContext", "(Landroid/content/res/Configuration;)Landroid/content/Context;", "GetCreateConfigurationContext_Landroid_content_res_Configuration_Handler")]
public abstract Android.Content.Context? CreateConfigurationContext(Android.Content.Res.Configuration overrideConfiguration);
[<Android.Runtime.Register("createConfigurationContext", "(Landroid/content/res/Configuration;)Landroid/content/Context;", "GetCreateConfigurationContext_Landroid_content_res_Configuration_Handler")>]
abstract member CreateConfigurationContext : Android.Content.Res.Configuration -> Android.Content.Context
參數
- overrideConfiguration
- Configuration
A Configuration 指定在原始上下文資源的基礎配置中要修改哪些值。 若基礎配置改變(例如方向改變),該上下文的資源也會改變,除非那些已明確覆寫為此處值的資源。
傳回
Context A 並覆蓋給定的配置。
- 屬性
備註
回傳一個新的 Context 物件,針對目前的 Context,但其資源會調整以符合給定的配置。 每次呼叫此方法都會回傳一個新的上下文物件實例;上下文物件不會共享,但共用狀態(如 ClassLoader、同一配置的其他資源)可能會共享,因此上下文本身可以相當輕量。
Java 文件 android.content.Context.createConfigurationContext(android.content.res.Configuration)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。