這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)XamarinEssentials中怎么獲取選項(xiàng)的值,文章內(nèi)容豐富且以專(zhuān)業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
(1)Get(string, bool)方法的語(yǔ)法形式如下:
public static bool Get(string key, bool defaultValue)
(2)Get(string, bool, string)方法的語(yǔ)法形式如下:
public static bool Get(string key, bool defaultValue, string sharedName)
(3)Get(string, double)方法的語(yǔ)法形式如下:
public static double Get(string key, double defaultValue)
(4)Get(string, double, string)方法的語(yǔ)法形式如下:
public static double Get(string key, double defaultValue, string sharedName)
(5)Get(string, float) 方法的語(yǔ)法形式如下:
public static float Get(string key, float defaultValue)
(6)Get(string, float, string)方法的語(yǔ)法形式如下:
public static float Get(string key, float defaultValue, string sharedName)
(7)Get(string, int)方法的語(yǔ)法形式如下:
public static int Get(string key, int defaultValue)
(8)Get(string, int, string)方法的語(yǔ)法形式如下:
public static int Get(string key, int defaultValue, string sharedName)
(9)Get(string, long)方法的語(yǔ)法形式如下:
public static long Get(string key, long defaultValue)
(10)Get(string, long, string)方法的語(yǔ)法形式如下:
public static long Get(string key, long defaultValue, string sharedName)
(11)Get(string, string)方法的語(yǔ)法形式如下:
public static string Get(string key, string defaultValue)
(12)Get(string, string, string)方法的語(yǔ)法形式如下:
public static string Get(string key, string defaultValue, string sharedName)
其中,參數(shù)說(shuō)明如下:
key:選項(xiàng)的鍵;
defaultValue:如果鍵不存在,返回默認(rèn)值。
sharedName:共享容器名稱(chēng)。
注意:在Get()方法中,如果指定的鍵存在,則獲取指定的默認(rèn)值。
【示例1-6】下面將獲取指定鍵的值。代碼如下:
void Preferences_Get(string key) { Preferences.Get(key, "default_value"); //獲取鍵對(duì)應(yīng)的值 }
上述就是小編為大家分享的XamarinEssentials中怎么獲取選項(xiàng)的值了,如果剛好有類(lèi)似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道。
分享名稱(chēng):XamarinEssentials中怎么獲取首選項(xiàng)的值-創(chuàng)新互聯(lián)
新聞來(lái)源:http://chinadenli.net/article26/ddescg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供虛擬主機(jī)、靜態(tài)網(wǎng)站、全網(wǎng)營(yíng)銷(xiāo)推廣、Google、微信公眾號(hào)、商城網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容